The MIDI Protocol: MIDI Messages | Simon Hutchinson

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Let's talk today about MIDI messages,  the vocabulary that MIDI devices use   to communicate with each other, and how  information is stored in MIDI format . I talked before about status bytes and data bytes. These two kinds of bytes work together to make up a MIDI message. There will always be one status byte in a MIDI message, telling us what kind of MIDI message we're transmitting, and on which channel. And this status byte will usually be followed by one or two data bytes, which give information about the values of that MIDI message. If that's still a little unclear, don't worry. It makes more sense when we get into the specifics. But before we talk about that, let's touch on MIDI channels, since the designation for MIDI channel takes up half of the status byte. You can set up MIDI instruments so that they respond to incoming messages according to a specification known as the "MIDI channel." This means I can have multiple devices in my MIDI chain and tell them to only listen to specific MIDI channels. For example, I could set up synthesizers to listen to Channel 7, Channel 8, and Channel 9. The one set up on Channel 7 will ignore data on all other channels, just paying attention to the MIDI messages that are set on Channel 7. So, setting the MIDI channel in the status byte allows us to mark information to be received by a particular MIDI instrument by assigning this channel. Another example of using channels would be if we had one sound module, but it was multi-timbral. So, for example, one sound module playing the entire orchestra. We could tell it: piano is on Channel 1, strings are on Channel 2, bass is on Channel 3, etc. And then we could send all of those MIDI channels to that one sound module, and it would know which messages are  supposed to go to which instruments. Now, of course, nowadays, a lot of our software is inside-the-box software plugins, but MIDI channels still exist. For example in the Kontakt sampler, you can set up  multiple instruments on different channels to have a violin on Channel 1, a clarinet on Channel 2-- much in the same way we would with an external module.   Back to our status byte, remember our bytes are eight digits--eight bits, and, in a status byte, the first digit will always be a 1, to designate it as a status byte. The next three digits tell us what kind of message it is, and the last four digits designate the MIDI channel. So with four bits to represent channels, how many  different channels is that? Two to the fourth. 2 x 2 is 4, x 2 is 8, x 2 is 16. So you'll be unsurprised to hear that there are 16 different MIDI channels. Anyway, that leaves us with three digits in the  status byte to show the kind of message. How many possibilities? Two to the third. 2 x 2 is 4, x 2 is 8. In this video, I'm only going to talk about the first 7 kinds of MIDI messages. The eighth message, 1111, is a bit unusual. It includes stuff like manufacturer-specific information and the MIDI clock, and it's best if we save that conversation for another day. The first 7 messages, while they do different things, operate in similar ways, combining with data bytes to communicate musical performance data. These messages are: Note Off, Note On, Polyphonic Aftertouch, Control Change, Program Change, Channel Aftertouch, and Pitch Bend Change. This is their order in terms of binary counting. I'm going to break this order a little bit in my explanation. For example, to start, let's talk about Note On before we talk about Note Off. Note On messages send information about which  key is pressed at what velocity and on what channel. So first there's our status byte--begins with a 1. Note on messages will always have 001, that designates it as a Note On, then a 4-bit number that designates the channel. That status byte will be followed by two data bytes. The first data byte is the key that was pressed. So if it's Middle-C, that'll be note number 60. Remember we have seven bits in this data byte after the initial 0 that marks it a data byte. So it can contain the value 0 to 127. Finally, there's a second data byte that has  another 7-bit binary number that designates the velocity. So this Note On message contains three bytes: one status byte and two data bytes.   Partner to Note On is Note Off, but the difference  is this is going to send information about the key that's released. It's a little surprising, but this is also a three-byte message. Once again, we have our status byte. This time it's a 1 followed  by three 0s. Those three zeros designate the Note Off message. Once again the channel information. Once again the key information.  we need to know which key has been released. And finally there's velocity information here too. You might not have known this, but how fast  you release a key is part of that MIDI message. Now, that doesn't mean all MIDI devices will report  this data, but it's part of that MIDI message. Similar to our Note On/Note Off, I want to next talk about Control Change. Control Change includes continuous controller information: knobs, pedals, and sliders on your MIDI controller. Once again we have a status byte. 1 designates the status byte. 011 designates it a Control Change. Next comes the channel, and then next comes the  controller number, which knob are we turning. Finally, we have a data byte that's the value that it has been turned to. So, looking at this, we know the range of all continuous controllers is also going to be 0 to 127, representable by 7 bits, and there's a maximum of 127 different continuous  controllers--different knobs that there can be. Next, let's talk about Program Change. This is a little bit of a relic in the days of software synthesizers but... Program Change messages were to send information about patch changes. Originally, there were 127 voices that were in all MIDI synthesizers. This was really convenient for video games, for example, because it allowed people with different hardware  to listen to music in at least kind of the same way. If you're interested, there are tons of great videos that compare different sound cards playing old games like "Day of the Tentacle" and things like that. And that's also why these 127 voices include  sound effects like, "bird," "telephone," and "gunshot." Once again helpful in accommodating games so they  don't have to have the PCM--the audio file-- They can play those sound effects with general MIDI. Program Change messages only consist of two bytes: the status byte starting with a 1, followed by 100, the channel, and then one data byte that says which new instrument we're going to change to.   Next let's talk about these aftertouches,  both polyphonic aftertouch and channel aftertouch. Aftertouch messages send information  about key pressure after the initial velocity.  So, I push down the key, and, in that Note On message,  it contains that initial velocity. After that, I can push the key down harder, lighten up a bit, and that information will be reported as MIDI data. If we think about synthesizers as just glorified pianos, this is a little odd, because mechanical pianos don't report this information. But, if you consider wind instruments, string instruments, there's a lot of change you can make to a note after that initial note hits. So, for example, this MIDI message could be mapped to the depth of an LFO, used to control the nuances of vibrato as a note is sustained. Now, there are two types of aftertouch: polyphonic and channel. Polyphonic aftertouch sends the individual pressure information from each key pressed (polyphonically). And channel aftertouch only sends the pressure information from the key with the highest pressure. So in polyphonic aftertouch this is a three-byte message: status byte, a data byte that designates the key, and a data byte that designates the value of the pressure. So in polyphonic aftertouch, each key  will report these three-byte messages. Channel aftertouch only sends the pressure  information from the key with the highest pressure, so it only needs two bytes. It needs to designate the channel, and then the value of that highest key pressed. So let's think about that. If I'm playing a three-note chord... polyphonic aftertouch will require three bytes for each note of the chord, so nine bytes. Whereas channel aftertouch only reports the highest pressure, so only requires two bytes. So you can see why channel aftertouch might be more attractive in situations where efficiency is necessary. Finally, I want to talk about Pitch Bend. It should be immediately interesting that pitch bend isn't included with the continuous controllers. Why wouldn't you just give it a number and put it together with the other controllers? The reason for this is pitch bend data is higher resolution. In the MIDI protocol, they decided they wanted  more detailed microtonal control than 0 to 127.   So how do they do that? Well it's quite clever. Once again, we have our status byte, numbered for the message, number for the channel, and then we have two data bytes. Now, we know in one data byte we can only use  seven bits to represent data. So 0 to 127.    But what if we took two data bytes and mashed them together? That would give us a 14-bit number. So, 2 to the 14th. I'm not going to go through it, but it's 16,384 different possible values, significantly higher than 0 to 127, giving us  a far more detailed microtonal control. This is especially useful for us to understand,  if we're looking for high resolution data in the MIDI protocol. Now, of course, in 2020, MIDI version  1.0 is not the only way to transmit musical data. That said, it's still ubiquitous and useful for us to understand. Different technologies like OSC--Open Sound Control--and high resolution MIDI offer new possibilities for both communication and nuanced musical control, but that doesn't mean the original MIDI protocol is going to be obsolete anytime soon. I'll talk more about these new technologies in  a later video, but we'll leave it here for now.
Info
Channel: Simon Hutchinson
Views: 2,610
Rating: undefined out of 5
Keywords: simon, hutchinson, simon hutchinson, music, composition, music composition, new media, sound, sound design, electronic, experimental, educational, tutorials, composer, audio, computer, computer music, new music, new, electroacoustic, music production, production, synthesis, MIDI, MIDI protocol, bits, bytes, binary, status byte, data byte, 0 to 127, counting in binary, MIDI Messages, Note on, Note Off, Pitch Bend, synth, OSC, note number, velocity, continuous contollers, High Resolution MIDI
Id: 2BccxWkUgaU
Channel Id: undefined
Length: 11min 1sec (661 seconds)
Published: Mon Nov 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.