How MIDI Works

J. Anthony Allen explains MIDI as a protocol where devices tell each other when to play sounds and how loud. A note-on message includes a velocity value from 0 to 127, with 0 turning notes off. When messages arrive too fast, the system can miss a note-off, leaving a stuck note ringing indefinitely.
Chapters
Okay, so we've talked about where MIDI comes from, but let's talk about what it actually is now and how we actually use it. So midi, as I said earlier, stands for Musical Instrument Digital Interface. Okay? It is a protocol. It is an event protocol, really. So that means it's kind of a little language. It's a language that lets one thing tell another thing when to do something and a little bit of how to do it. Okay? So it says, make this sound, and then some parameters perhaps, like make this sound this loud or that loud. The way we see it on the screen is with these little dots. So each one of these little dots says, turn on this note. In fact, it's actually a little more specific than that. Let me zoom way in here. So what it really says is right here, the computer is going to send a message that says, turn on this note. And it's going to say, turn on the note this loud. This is my velocity. Let's make that a little bit bigger. So it says, turn on this note and turn it on this loud. Okay? Velocity is always written as 0 to 127. So 0 means off, and 127 is the loudest we can go. So that's our range of volume or velocity. So turn this node on at a velocity of. Let's see what this is, about 80. Then that's the end of the message. That node is on, and it's going. So at this point, The computer sends another MIDI message, and that message says, turn that node off. But this is where MIDI is a little funny. It doesn't actually say, turn that node off. What it says is at this point, it says, turn that note on. It's already on. But this is how you turn a note off in the MIDI protocol, it says, turn this node on at end the velocity of zero. That's how you turn a note off. In MIDI lingo, this isn't really something you need to keep track of. This is something the computer will really hide from all of us. But that's how MIDI messages work. They say, turn a note on at this velocity, and then at the end of the note, they say, turn that note on with a velocity of zero. That's how you turn a note off. It's a little strange, but it works. So this is why one of the drawbacks of MIDI actually, is that you sometimes get something called stuck notes. And that's because if you have, like a ton of notes going at once. Let's do this. Let's say you have something like this happening, Okay? You might. We might get, in this case and we'll try it in a second, something called a stuck note. And a stuck note means we're going to play through this and one of the notes isn't going to turn off, it's going to stay on and it's going to hang there. Let's try. This might be a little painful sounding. Oh, that was extremely fast. We also don't have a great sound for this. Let's look at our sound and say a simpler sound on this, a sound that is more simple. Oh, that was a little too fast. It's just going to play these as a chord. So let's stretch this out a little bit. Well, maybe not. Let me adjust our sound a little bit here. Not getting one. Ableton's pretty good about not doing it, but sometimes it happens. And when, when you get a stuck note, what it is is it's the computer just losing track. So here we have play note f6 and then at a velocity of 80, and here play f note 6 at a velocity of 0. But before that velocity of 0 came we had play note f6 at a velocity of 80 and then play g6 at a velocity of 80, play g sharp 6, etc. All these notes and then all these note off messages, right? So if it doesn't get one of the note off messages, then you have. Because there's just too much data flying really fast, it can get a little confused. And then you have what's called a stuck note, meaning one note in this whole bit might just sound like it's going on forever. You can usually fix it by turning the instrument on and off again, muting the track, unmuting the track, or just hitting that note again. Because if this note is stuck and it's going and it just keeps ringing, if you play it again, what you'll get is a note on and a note off. And that will shut the note off. So stuck notes can happen because of that. If you've ever just played a synthesizer and then you stop playing and there's like a note ringing out of nowhere. Find the note that's ringing and play it again. That'll stop it. It's called a stuck note. And it's really just the protocol. Too much stuff flying through the protocol at once and the computer missing one of the note off messages. Doesn't happen very often anymore on programs like Ableton because they're pretty smart, but sometimes it does happen. So, main thing to remember, MIDI is a protocol. It's just a language that tells us to turn things on and turn things off at different points.










