How to Speak MIDI

HTSM_Featured.png

MIDI is ancient, but hella useful.  It drives the keyboards you see at Guitar Center, controls things like lighting and pyrotechnics at concerts1, and has been used to score virtually every film in the last few decades.

The Prophet 600 was one of the first synths to ever support MIDI.

If you're a modern musician, a working knowledge of MIDI is essential. If you're the sort of person that reads blog posts like these, odds are good that you already have some experience working with it; however, I think it's helpful to know not just how to use it, but how to read it, on a bit-by-bit level.  Translating and assembling your own MIDI messages might sound daunting at first, but it's actually really easy, and I think it's an important skill for any modern composer to have. It's akin to knowing how microphones work as a recording engineer.

This article will serve as a comprehensive introduction and guide to MIDI messages as they apply to music production. What this guide is not is a tutorial on MIDI composition, or how to use the MIDI editor in your DAW. However, this guide is absolutely geared for composers, as you'll find that a fundamental knowledge of MIDI will help a great deal when figuring out your more advanced (and complicated) MIDI tools. Let's get started.

1. What MIDI Is

I like to start teaching things from the beginning. However, if you're already clear on what MIDI is and what it does, feel free to skip to How It Works, where we'll dive right to the nuts and bolts. Otherwise, let's review.

MIDI is an acronym that stands for "Musical Instrument Digital Interface". Essentially, it's a way for computers to describe and transmit musical performances to each other. Actually, it's the way. If you were born after the 80's, then probably every keyboard or drum machine you've ever seen uses MIDI. While many attempts have been made to overhaul or replace MIDI over the years, instrument manufacturers and developers really just don't seem to care about using anything else.

With MIDI, you can:

  • Record musical performances and edit them with surgical precision

  • "Patch" a performance to any instrument with little to no work

  • Procedurally generate or resequence performances

  • Arrange ensemble performances with a single connection

  • Perform rudimentary mixing, complete with "automation"

Because of the versatility and speed of modern MIDI tools, music composition has moved to it almost wholesale. Gone are the days of writing with a piano, scoring pad, pen and paper. With MIDI, you get WYSIWYG2 previews of your music at every stage. Even in Hollywood, where recording a full orchestra is basically standard, the sheet music isn't even produced until the director listens to and okays a MIDI mockup -- meaning the score is fully composed before it ever touches paper.

And that's if the score even gets performed. While the virtual orchestras of the 80's sounded laughably fake, modern instruments sound so good that casual listeners can't even tell the difference. And that's changed everything. In lower-budget films and TV shows, the soundtrack will often use MIDI orchestras in the final version, and audiences are none the wiser. And amazingly, such tools are available to musicians at almost every income level.

The above "recording" was completely synthesized using MIDI instruments.

1.1 What MIDI is Not

Before continuing, I want to dispel a couple of misconceptions newcomers sometimes have. It won't take long.

First, MIDI doesn't make music: it just tells other devices how to make music. But it can do other stuff, too. For example, in professional video software, MIDI messages are used to control things like animation parameters. Many studio control surfaces use MIDI to control mixing software, and this fancy-ass player piano uses it to trigger robotic actuators. The point I'm trying to make is that while MIDI data is predominantly used to control virtual instruments, it can really be used for anything at all, and doesn't "sound" like anything on its own.

The tools a MIDI composer uses abstract away computer code into something easier to visualize. (Screenshot of Nuendo 8)

Second, MIDI data is not just "sheet music for computers", however useful the analogy can be. While western sheet music is the medium that has encoded all of history's most expressive music, the truth is that it leaves considerable room for interpretation -- and computers don't handle ambiguity very well.

Instead, MIDI is probably best thought of as a programming language, and your MIDI editor as a visual programming environment. MIDI editors represent MIDI commands as shapes on piano rolls, instead of what they actually are: glorified digital instructions. And like all programming languages, MIDI is subject to all kinds of bugs and glitches. For example, if a "note on" message isn't properly paired with a "note off", then the note just keeps on playing forever, because computers lack the common sense to stop.

Anyways, I'm tired of writing this introduction. Let's peel back all those layers of abstraction, and learn, at a fundamental level, How To Speak MIDI.

2. How It Works

Like pretty much everything in computers, MIDI boils down to a bunch of ones and zeros.  Each digit is called a bit (short for "binary digit") and eight of them form a byte.3  When you play a digital piano, MIDI messages are generated internally and sent to the instrument's tone generator, where they are interpreted and converted into audible sound. If you took a peek at the signal, the messages generated might look something like this:

10010000 00110111 01001110 10000000 00110111 00000000 10010000 00110111 01001101 10000000 00110111 00000000 10010000 00110111 01010001 10000000 00110111 00000000 10010000 00110011 01011010 10000000 00110011 00000000

This is the binary form of a simple MIDI performance: the first four notes of Beethoven's Fifth. If you were to record this sequence and repeat it to another MIDI instrument exactly as it was delivered, the result would be an identical copy of the performance. If you messed with the timing, you'd change the pace of the performance. Everything else about the performance is encoded in the data itself.

It's sort of interesting to realize that composers nowadays basically spend their time crafting, editing and tweaking what boils down to a timed delivery of numbers. Anyway, let's break down the task of interpreting this mess, one step at a time.

2.1 Separating Messages

The first thing to know about MIDI messages is that they almost always span more than one byte. This makes sense if you consider that there are only 256 unique 8-bit numbers, and we probably need to encode much more information than that to describe something as expressive as a musical event.

So, if you're receiving a message in several small packages, possibly all at once, how do you know where one message ends and the next begins? Realistically, if you know how many bytes to expect per message and you start at the top, you should be able to tell them apart, so long as none of them are lost in transmission. However, MIDI offers us a sure-fire way to parse out every message: by dedicating the first bit of every byte to the cause.

RULE 1: If the first bit of a MIDI byte is a 1, then the byte is a status byte, which marks the first part of a MIDI message. If the first bit is a 0, then it is a data byte, which form's the message's body.

Easy. Every time a byte leads with a 1, we know we're reading the start of a new message, and we can interpret the following bytes in concert with the first. Let's use that rule to break down the above MIDI performance into discrete messages.

Message 1: 10010000 00110111 01001110
Message 2: 10000000 00110111 00000000
Message 3: 10010000 00110111 01001101
Message 4: 10000000 00110111 00000000
Message 5: 10010000 00110111 01010001
Message 6: 10000000 00110111 00000000
Message 7: 10010000 00110011 01011010
Message 8: 10000000 00110011 00000000

Now that we're looking at something a bit more orderly, you might notice a few patterns popping out. For one thing, there's only two unique versions of each byte. Knowing that these messages represent the first four notes of Beethoven's Fifth Symphony, can you guess what they mean?

2.2 Status Bytes and Data Bytes

The status byte of a MIDI message serves as its header, and so is the most important part. It tells us what the message does, and how to interpret the following data bytes. What the data bytes encode depends on the message, but they will typically provide information important to carrying out the message. If the status byte says, "jump," the data bytes might tell you how high.

Because the first bit of every byte is reserved to tell the two byte types apart, there's only seven bits usable by either. Here's how they are used:

Diagram showing which bits do what in MIDI bytes.  The second, third, and fourth bits of status bytes indicate message type, and the fifth, sixth, seventh, and eighth indicate a MIDI channel.  In data bytes, bits two through eight encode a 7-bit num…

RULE 2: Bits 2, 3, and 4 of a status byte identify its message type. Bits 5-8 identify the MIDI channel it is addressing. Data bytes serve different functions depending on the message type.

Three bits to determine the message type and four for the channel number means that there are eight distinct message types, and 16 possible channels. Data bytes can contain any value from 0 to 127. While the overwhelming majority of messages use two data bytes, that number can actually differ depending on the message's needs. For example, "program change" messages only need one data byte, and "system exclusive" messages can have an arbitrary number.

If you've worked with MIDI before, you're probably already familiar with MIDI channels. But in case you're not, every MIDI connection can command up to 16 voices. The status byte specifies in its four least significant bits which of these channels the message is addressing.4

3. Message Types

The following table identifies the different MIDI message types, and how they use data bytes. We'll explore each in the following subsections.

Message Type Status Byte (Binary) Status Byte (Hex) Data Byte 1 Data Byte 2
Note Off 1000nnnn 0x8n Note Number Velocity (discarded)
Note On 1001nnnn 0x9n Note Number Velocity
Polyphonic Key Pressure 1010nnnn 0xAn Note Number Pressure Value
Control Change 1011nnnn 0xBn CC Number5 CC Value
Program Change 1100nnnn 0xCn Program Number
Channel Pressure  1101nnnn 0xDn Pressure Value
Pitch Bend  1110nnnn 0xEn LSB MSB
System 1111mmmm 0xFn Depends. Depends.

The "n's" here are to be substituted with a MIDI channel number, minus one. The "m's" represent a system message type.

3.1 Note Off / Note On (0x8n, 0x9n)

These are the most elementary of the MIDI messages and are the easiest to understand. When you want to play a note, send a "note on" message, and when you want to end it, send a "note off" message. These messages use two data bytes: the first identifies what pitch you want to control, and the second identifies a velocity.6 A "note on" with a velocity of 0 produces no sound, and is equivalent to a "note off" message.

Considerations:

  • The existence of zero-velocity "note on" messages means that "note off" messages are totally unnecessary. The MIDI standard specifically states that "note off" and zero velocity "note on" messages are equivalent and must be treated identically. As a result, one device may untrigger notes differently than another.

  • While transmitters only need to use one method of untriggering notes, receivers need to be able to handle both.

  • While a velocity value doesn't make much sense in a "note off" message, it is still part of the message and should be sent. The value is unused and is discarded.

3.1.1 About MIDI Pitch Numbers

Pitch numbers are mapped to piano keys essentially one-to-one. However, because there are 128 possible values and only 88 piano keys, MIDI actually supports 40 semitones not found on the piano. 19 of them are located above the highest note, C7, and the other 21 are below the lowest note, A-1. The MIDI pitch range is more or less centered about Middle C, which is note number 60.

Be aware that manufacturers don't all agree on octave numbers. Scientific pitch notation, used by analog musicians, identifies the lowest C on the piano as C1, which makes Middle C C4. Programmers, on the other hand, often start counting with 0, so to them, the lowest C is C0, and Middle C is C3. This is the notation I usually use, because it's what all my MIDI tools use. However, no matter what system you use, Middle C is always note number 60.

In Appendix II, I provide a chart for converting to and from MIDI pitch numbers.

3.2 Control Change (0xBn)

"Control change" messages are used to modify a channel's continuous controllers. A continuous controller is analogous to an automation lane; it allows ongoing control over different aspects of a channel's performance.

The first data byte identifies the CC number (0-119), and the second assigns it a value (0-127).

Considerations:

  • Unlike the name implies, continuous controller data is not continuous. Instead of smoothly interpolating between values the way automation does, a CC lane's current value can only change in discrete steps. To smoothly ramp to another value, you must send a large number of "control change" messages, incrementing or decrementing the value at a controlled rate.

  • The MIDI specification defines what most of the 120 CC's are intended to be used for, though very few devices observe more than a handful. I provide a table of all the CC's in Appendix III.

  • The last eight CC numbers (120-127) don't actually represent CC's at all. Instead, they represent a special category of message called channel mode messages. Channel mode messages are specialized commands that affect the entire device that receives it. In practice, you won't have to worry about them too much, but I provide more information about them in Appendix I.

  • CC numbers 0 and 32 are used by a lot of devices for patch selection purposes. Read more about it in Appendix IV.

3.3 Pitch Bend (0xEn)

Bends the pitch up or down. Duh.

Pitch bend behaves a bit like a CC. In fact, most MIDI editors treat Pitch Bend like it's just another CC. However, a 7-bit CC value, with 128 possible values, doesn't offer enough resolution to sell a pitch bend effect. Our ears are amazing at resolving pitch height, and so even when we approach a new pitch 1/128th of the way at a time, it doesn't sound smooth and organic.

To get a finer resolution, "pitch bend" messages use two data bytes to transmit a single large value. Basically, if you squish together seven bits of one message and seven bits of another, you can assemble a single 14-bit value, increasing your resolution by a factor of 2^7, or 128.

Diagram showing how bits from a MIDI MSB and LSB combine to make a single 14-bit value.  The rightmost seven bits of each byte are concatonated, and the first bit of the separate bytes are discarded.  The result is a single 14-bit number, where the …

Now, instead of 128 possible values for our pitch bend, we have a whopping 16,384 -- more than enough steps to make a smooth pitch bend effect. The right half is provided by the first data byte (the Least Significant Byte, or LSB) and the left half is provided by the second (the Most Significant Byte, or MSB).

Considerations:

  • The strength of the pitch bend (how many semitones up or down a maxed-out pitch bend represents) differs from instrument to instrument. It is often configurable.

  • Pitch bend is "centered" at 8192 (where there is no pitch change).

  • Pitch bends affect all playing notes on a channel, just like CC's do.

  • Programming with MSB's and LSB's is best done with bitwise operators. I'm not gonna go over those here, but I've provided some resources in Appendix V if you want to learn more.

3.4 Polyphonic Key Pressure and Channel Pressure (0xAn, 0xDn)

Some MIDI controllers, such as the Akai MPK225, feature something called aftertouch. Aftertouch controllers are sensitive not only to the velocity of each key press, but continuously sensitive to the pressure with which keys are held.

Aftertouch comes in two varieties: channel aftertouch and polyphonic aftertouch. Channel aftertouch, also known as mono pressure, measures pressure across the entire keyboard, whereas polyphonic aftertouch measures pressure independently for every key. Due to the lower hardware cost, channel aftertouch is the more common of the two. Channel pressure messages only use one data byte, which represents the overall pressure level. Polyphonic key pressure messages use two: the first reports the pitch (using the standard pitch numbers), and the second reports its pressure.

Considerations:

  • Polyphonic aftertouch is the only control that can be set independently for each pitch. Every other control (besides note on or off) affects the entire channel.

  • An extension to MIDI, called "MIDI Polyphonic Expression" (MPE), is designed to allow CC's and pitch bend to be applied polyphonically as well. MPE is not very common, but has been popularized by devices like the ROLI Seaboard. I've provided links to resources that cover it in Appendix V.

3.5 Program Change (0xCn)

If you don't use a lot of external MIDI hardware, you probably won't use this message type too often. A "program change" message commands a device to load a new program (a new patch or preset). It only uses one data byte, which specifies the index of the patch.

This message type is super helpful when composing with external MIDI devices. As long as your hardware supports presets, your project or session can handle selecting and loading them: just sequence the appropriate "program change" messages at the start.

Considerations:

  • Instruments with more than 128 presets generally store their patches across multiple banks. To recall programs stored in other banks, CC's 0 and 32 are repurposed into "bank select" messages. In Appendix IV, I go over how this works.

  • With clever scheduling of program change messages, it's possible for a single device to use more than 16 different patches in one piece, as long as they aren't playing simultaneously. Though to be real, you should probably split things up into separate captures if you need to milk that many voices out of a single device.

  • Cubase and Nuendo offer native support for program change messages in the MIDI track inspector. I'm not sure how many other DAWs support this.

3.6 System (0xFn)

System messages are an advanced topic that I'm not going to cover here. They really deserve an article of their own. They're used for all kinds of things; giant data transfers (called "dumps"), synchronizing clocks, transmitting timecode, and more.

In the future, I may write up a guide to system messages, but for now, don't worry about them. Just be aware that they exist, and aren't generally used in MIDI composition.

4. About Hexadecimal

Before going on, we should talk about all those 0x's I used in the previous section. The prefix 0x tells you that a number is in hexadecimal.7 As you dive into your advanced MIDI tools and device manuals, you'll notice that MIDI messages are almost always represented in hexadecimal instead of binary or base ten. This might seem counter-intuitive at first -- I mean, if you're going to convert a binary number at all, why not just convert to human-readable base ten?

The answer is that it's just more practical. While I think binary is the best way to start learning MIDI, it's pretty cumbersome to actually work with. Spreading out every byte over eight digits makes reading and writing a chore, and since everything in binary is just ones and zeroes, it's easy to lose your place when reading long sequences.

HexDecimal.png

Flipping a bit in a binary number can only affect one digit of its hexadecimal representation.

So, bitwise programmers usually work in hexadecimal. It reduces every byte to just two digits, and because 16 is a power of 2, each bit you change only affects one digit in hex. That allows you to think of each hexadecimal digit as its own four-bit number. If you wanted to work bitwise on a decimal representation, you'd have to convert the entire byte into binary and back again.

There's only a few things to keep in mind when working with MIDI in hexadecimal.

  • Because of the way the bits are grouped in hexadecimal, you can tell which MIDI channel a status byte is addressing by looking at nothing more than the righthand hex digit.

  • If the left-hand digit of a byte is 0x7 or less, you know it's a data byte, and likewise, you know a byte starting with 0x8 or greater is a status byte.

  • The maximum data byte value, 127, is 0x7F in hexadecimal.

You got it! You don't need to know anything else to start speaking MIDI. Let's apply what we've learned to translate the example from above: the first four notes of Beethoven's Fifth.

5. Applied Example: Beethoven's Fifth Symphony

When we last left off with this example, we had just broken down the raw binary into discrete messages. That looked like this:

Message 1: 10010000 00110111 01001110
Message 2: 10000000 00110111 00000000
Message 3: 10010000 00110111 01001101
Message 4: 10000000 00110111 00000000
Message 5: 10010000 00110111 01010001
Message 6: 10000000 00110111 00000000
Message 7: 10010000 00110011 01011010
Message 8: 10000000 00110011 00000000

To make this easier to wrangle, let's convert it to hexadecimal. I'll leave the status bytes red, and the data bytes blue.

Message 1: 0x90 0x37 0x4E
Message 2: 0x80 0x37 0x00
Message 3: 0x90 0x37 0x4E
Message 4: 0x80 0x37 0x00
Message 5: 0x90 0x37 0x4E
Message 6: 0x80 0x37 0x00
Message 7: 0x90 0x33 0x4E
Message 8: 0x80 0x33 0x00

Knowing what we know now, we recognize that the 0x9's and 0x8's leading the status bytes identify the messages as "note on" and "note off" respectively. The right digit of the byte tells us that they are targeting MIDI Channel 1.8

Here's what the performance looks like with translated status bytes.

Message 1: Note On (Channel 1) 0x37 0x4E
Message 2: Note Off (Channel 1) 0x37 0x00
Message 3: Note On (Channel 1) 0x37 0x4E
Message 4: Note Off (Channel 1) 0x37 0x00
Message 5: Note On (Channel 1) 0x37 0x4E
Message 6: Note Off (Channel 1) 0x37 0x00
Message 7: Note On (Channel 1) 0x33 0x4E
Message 8: Note Off (Channel 1) 0x33 0x00

In the "note on" and "note off" message types, the first data byte encodes a pitch, and the second encodes a velocity. The velocity value is just a number. To figure out the pitch, we need to refer to a MIDI note table. And remember, "note off" velocities are unused.

Let's finish the translation:

Message 1: Note On (Channel 1) G2 Velocity:78
Message 2: Note Off (Channel 1) G2 Velocity:0
Message 3: Note On (Channel 1) G2 Velocity:78
Message 4: Note Off (Channel 1) G2 Velocity:0
Message 5: Note On (Channel 1) G2 Velocity:78
Message 6: Note Off (Channel 1) G2 Velocity:0
Message 7: Note On (Channel 1) D#2 Velocity:78
Message 8: Note Off (Channel 1) D#2 Velocity:0

That's it! Those are the translated MIDI instructions encoding the first four notes of Beethoven's Fifth. Dum dum dum duuum!

Knowing what you know now, you can craft and decode common MIDI messages by hand. More advanced tools, such as MIDI transformers and logical editors, are now open to you. However, there's always more to learn. If you're a glutton for knowledge, I've provided some resources you can use to study MIDI further in Appendix V.

6. Bonus Lesson: Running Status

There's a handy shortcut MIDI offers that I haven't mentioned until now for the sake of keeping things simple. Here's how it works: once you send a status byte, you don't have to send another until it would differ from the last. The last status byte received sort of remains "on", and is used to interpret all the data bytes to follow. This is referred to as Running Status.

Consider the following string of bytes:

0x90 0x37 0x4E 0x37 0x00 0x37 0x4E 0x37 0x00 0x37 0x4E 0x37 0x00 0x33 0x4E 0x33 0x00

What you're looking at is the exact same performance of Beethoven's Fifth we translated in the applied example, but with almost all the status bytes missing. However, because of Running Status, this performance is just as valid as the first. Once we send the status byte 0x90, it becomes the Running Status, and every pair of bytes following can be treated as if they were preceded by their own "0x90".

This allows us to cut out a lot of repeated status bytes, which can dramatically shorten our MIDI streams. Back when computers were slower and baud rates were more restrictive, this was incredibly helpful. Today, however, computers are so fast that using Running Status doesn't really make a noticeable performance improvement. I still bring it up, however, because if you find yourself doing any MIDI programming, you should be prepared to see status bytes being omitted here and there.

Notice that because zero velocity "note on's" count as "note off's", we can both start and end notes without breaking running status; at least, until we need to send a control change or a message to a different channel.

Appendices

Appendix I: Channel Mode Messages

"Channel mode" messages are special commands that alter an entire device's behavior by changing its MIDI mode. Well, sort of.

In practice, "channel mode" messages are just used to turn on or off certain features and send certain commands. What MIDI enumerates as "modes" are essentially just different configurations of the Omni and Poly toggles. To be honest, I don't think "modes" are a super apt way to think about these commands; but I'll at least explain what the commands do.

Channel mode messages don't have their own message type. Instead, what would have been the last eight continuous controller numbers (CC's 120-127) are repurposed. The channel mode messages are as follows:

Name “CC” Number Status Byte Data Byte 1 Data Byte 2
All Sound Off 120 0xBn 0x78 0x00
Reset All Controllers 121 0xBn 0x79 0x00
Local Control 122 0xBn 0x7A 0x00 (off), 0x7F (on)
All Notes Off 123 0xBn 0x7B 0x00
Omni Mode Off 124 0xBn 0x7C 0x00
Omni Mode On 125 0xBn 0x7D 0x00
Mono Mode On 126 0xBn 0x7E 0xmm
Poly Mode On 127 0xBn 0x7F 0x00

The letter "n" here represents a MIDI channel, which must be the device's basic channel. For "mono mode on", the "m's" represent a quantity of channels ranging from 0x00 to 0x10 (see the "mono mode on" summary below).

In order for a device to respond to channel mode messages, it needs to receive them on its basic channel. A device's basic channel is the only MIDI channel on which channel mode messages are considered valid. For a lot of devices, this channel is configurable. That way, channel mode messages can target specific devices within a daisy chain.

What follows is a quick summary of each channel mode message. Appendix V contains resources for further study.

  • All Sound Off ("CC" 120): Cuts off all sound the instrument is currently making, including note decay and reverb effects.

  • Reset All Controllers ("CC" 121): Sets all CC's, switch controllers, pitch bend and aftertouch effects to their defaults. What value each controller returns to depends on the controller, and is defined in the MIDI spec.

  • Local Control ("CC" 122): Disconnects the keyboard on a synthesizer from its tone generator. This allows you to use a synthesizer as a MIDI controller while at the same time sequencing for it. Set to 0x00 to turn local control off, and 0x7F to turn it back on.

  • All Notes Off ("CC" 123): The "panic button." All Notes Off is equivalent to sending "note off" messages for every pitch on every channel. It's handy for resolving stuck notes. Locally triggered notes are unaffected.

  • Omni Mode Off/On ("CC's" 124, 125): When Omni mode is on, every channel will respond to every inbound message, no matter which channel is indicated in the status byte.

  • Mono Mode / Poly Mode ("CC's" 126, 127): Forces a voice or voices to monophonic behavior or polyphonic behavior. If the "mono mode on" value is set to 0x00, then the basic channel, and every channel above it, will be set to mono mode. For any other value n, channels n through n+m-1 will be set to mono mode (where m is the value of the second data byte). A "poly mode on" message will set all channels back to poly mode.

Appendix II: MIDI Pitch Chart

OctaveNote Numbers
 CC#DD#EFF#GG#AA#B
-201234567891011
-1121314151617181920212223
0242526272829303132333435
1363738394041424344454647
2484950515253545556575859
3(60)6162636465666768697071
4727374757677787980818283
5848586878889909192939495
696979899100101102103104105106107
7108109110111112113114115116117118119
8120121122123124125126127   

Octave numbers here are programmer style, where "C0" represents the lowest C on an 88-key piano. For scientific pitch notation, increase the octave numbers by one.

Appendix III: Standard CC Assignments

The MIDI specification defines standardized uses of CC's, which I've copied here. All CC numbers are defined, except for: 3, 9, 14, 15, 20-31, 85-90, and 102-119.

I've marked the most commonly used CC's in red font, and undefined CC's in blue. I don't explain the function of each CC, but I've provided some resources in Appendix V if you want to learn more about them.

Control Number Control Function
Dec Hex
0 0x00 Bank Select
1 0x01 Modulation
2 0x02 Breath
3 0x03 Undefined
4 0x04 Foot controller
5 0x05 Portamento time
6 0x06 Data entry MSB
7 0x07 Channel Volume
8 0x08 Balance
9 0x09 Undefined
10 0x0A Pan
11 0x0B Expression
12 0x0C Effect Control 1
13 0x0D Effect Control 2
14-15 0x0E-0x0F Undefined
16-19 0x10-0x13 General Purpose Controllers (#’s 1-4)
20-31 0x14-0x1F Undefined
32-63 0x20-0x3F LSB for values 0-31*
64 0x40 Sustain
65 0x41 Portamento On/Off
66 0x42 Sostenuto
67 0x43 Soft pedal
68 0x44 Legato
69 0x45 Hold 2
70 0x46 Sound Controller 1 (default: Sound Variation)
71 0x47 Sound Controller 2 (default: Timbre/Harmonic Intensity)
72 0x48 Sound Controller 3 (default: Release Time)
73 0x49 Sound Controller 4 (default: Attack Time)
74 0x4A Sound Controller 5 (default: Brightness)
75-79 0x4B-0x4F Sound Controllers 6-10 (no defaults)
80-83 0x50-0x53 General Purpose Controllers (#’s 5-8)
84 0x54 Portamento Control
85-90 0x55-0x5A Undefined
91 0x5B Effects 1 Depth
92 0x5C Effects 2 Depth
93 0x5D Effects 3 Depth
94 0x5E Effects 4 Depth
95 0x5F Effects 5 Depth
96 0x60 Data increment
97 0x61 Data decrement
98 0x62 Non-Registered
99 0x63 Non-Registered Parameter Number MSB
100 0x64 Registered Parameter Number LSB
101 0x65 Registered Parameter Number MSB
102-119 0x66-0x77 Undefined
120-127 0x78-0x7F Reserved for Channel Mode Messages

*The MIDI spec actually allows for 14-bit versions of the first 32 CC's by treating them as MSB's and CC's 32-63 as corresponding LSB values. However, very few instruments take advantage of this.

Appendix IV: Bank Change Messages

Modern synthesizers can store and recall many, many more presets than can be addressed by a single program change message. To get around this, manufacturers often sort their programs into banks. Each bank has a maximum of 128 presets, and a unique 7-bit or 14-bit address.

To recall a patch from a different bank, you must first send a "bank select" message with its address. After that, send a program change message as usual, and the patch loaded will come from the new bank.

Name Status Byte Data Byte 1 Data Byte 2 Status Byte Data Byte 1 Data Byte 2
Bank Select (7-bit) 0xBn 0x00 Bank Address (unused) (unused) (unused)
Bank Select (14-bit) 0xBn 0x00 Bank Address MSB 0xBn 0x20 Bank Address LSB

As always, "n" represents the MIDI channel number.

As you might've noticed, these are actually "control change" messages for CC's 0 and 32. For 7-bit addresses, only CC 0 is used. For 14-bit addresses, CC 0 represents an MSB, and 32 an LSB. If you need a primer on MSB's and LSB's, there's one in the Pitch Bend section of the main article.

Whether a device uses 7-bit or 14-bit addresses is kind of arbitrary, and you'll need to check your manual to know which to use when communicating with your device.

Appendix V: Additional Resources

  • The MIDI Association: The MIDI Association is the primary repository of information about or related to MIDI technology. It's free to register, and once you do, you can download The Complete MIDI 1.0 Detailed Specification here.

  • Bitwise Operation (Wikipedia): I know, I know, Wikipedia isn't a good primary resource, but I like this article because it's language-neutral and doesn't have ads. Study up on arithmetic bit shifts and bitwise OR, which are useful when working with MSBs and LSBs.

  • What is MPE?: An article in ROLI's support database going over MIDI Polyphonic Expression, which is used in multidimensional controllers like the Seaboard products. MPE was formally adopted by the MIDI Manufacturer's Association in January 2018, and a download link to the spec is available here.

  • MIDI Modes (Electronic Music Interactive v2, University of Oregon): This page offers a good, concise overview of the four standard MIDI modes. It's part of a longer online course on electronic music.

  • MIDI CC List (Nick Fever): A list of the standard CC's with more elaborate explanations. If you still need more information after going through Nick's list, refer to The Complete MIDI 1.0 Detailed Specification, which you can download here.

  • MIDI System Common Messages, MIDI System Realtime Messages, and MIDI System Exclusive Message (RecordingBlogs Wiki): Excellent introductions to each kind of system message.

  • MIDI Registered Parameter Number (RecordingBlogs Wiki): An overview of Registered Parameter Numbers, which can be thought of as an extension to the CC's. Once you understand RPNs, NRPNs (Non-Registered Parameter Numbers) will also be accessible to you.


  1. This is done with an extension to MIDI called MIDI Show Control.

  2. “What You See is What You Get.”

  3. In other resources, you might hear the term “word” used to describe these instead. It’s not important to know why unless you’re a computer scientist, but just know that in this context, “byte” and “word” can be used interchangeably.

  4. MIDI channel numbers start with 1, while their representation here starts with 0. A value of 0 means Channel 1, and a value of 15 means Channel 16.

  5. If this number is 120 or greater (0x78 and greater) then the message is a special type of message called a ‘channel mode” message. In Appendix I, we explore what these messages do.

  6. Velocity can be thought of as how “hard” a note is struck.

  7. Another common notation is to follow the number with a capital letter “H”, as in “78H”.

  8. Remember, even though the number in the message is a zero, it corresponds to Channel 1 because we start counting numbers at 0 and channels at 1.