Chapter Three: MIDI

3. MIDI Data Format: Message Types

The majority of MIDI communication consists of multi-byte packets beginning with a status byte followed by one or two data bytes. Bytes are groups of 8 bits (0's or 1's—a '1' is called set and a '0' is called reset). Status bytes begin with a '1' as their most significant bit (e.g., 1xxx xxxx) and are therefore 128 decimal or higher. Data bytes begin with a '0' (e.g., 0xxx xxxx) and are therefore 127 decimal or lower.

The status byte that begins a Note On message on channel 1, followed by a data byte carrying the note number 60 (middle C).

Two bytes drawn as rows of eight boxes. The status byte reads 1 0 0 1 0 0 0 0. Its first bit, a 1, is highlighted as the flag that marks a status byte; the next three bits, 001, give the message type, Note On; the last four bits, 0000, give the channel, channel 1, and a note beneath says that 0000 through 1111 stand for channels 1 through 16. The whole byte equals 144, in the range 128 to 255. The data byte reads 0 0 1 1 1 1 0 0. Its first bit, a 0, is the flag that marks a data byte, and the remaining seven bits, 011 1100, give the value 60. Data bytes range from 0 to 127.

Each byte is framed by a start bit before it and a stop bit after it, so each byte takes 10 bits to send. The eight data bits go out least significant bit first, the reverse of the order in which we write them. At MIDI's rate of 31,250 bits per second, that comes to 320 µs per byte, about a third of a millisecond.

The same status byte on a MIDI cable, sent at 31,250 bits per second. Note the order of the bit numbers.

The status byte 1001 0000, Note On on channel 1, as it travels down a MIDI cable. Across the top, ten boxes in time order: a start bit of 0, then data bits D0 through D7 reading 0 0 0 0 1 0 0 1, then a stop bit of 1. D7, the status flag, is highlighted. Below, a square wave traces the same sequence between two levels, 1 for no current and 0 for current on. The line idles at 1, drops to 0 for the start bit and the first four data bits, rises for D4, drops for D5 and D6, and rises for D7 and the stop bit, where it stays at idle. A bracket under the whole frame reads 10 bits equals 320 microseconds, and an arrow shows time running left to right. At the bottom, labeled as written, the reverse of the order sent, the same eight data bits run D7 to D0 and read 1 0 0 1 0 0 0 0, equals Note On, channel 1.

Messages fall into one of two main classes, Channel and System. Everything on this page describes MIDI 1.0. MIDI 2.0, adopted in 2020, keeps the same families of messages but packages them in Universal MIDI Packets built from 32-bit words, with much finer resolution for values such as velocity and controller data.

Ranges are status-byte values in decimal.

A tree diagram of MIDI message types with their status-byte ranges in decimal. MIDI messages divide into Channel messages, status 128 to 239, and System messages, status 240 to 255. Channel messages divide into Voice, 128 to 239, and Mode, which uses status 176 to 191 with controller numbers 120 to 127. System messages divide into Common, 241 to 247, where 247 is EOX; Real-Time, 248 to 255; and Exclusive, which starts with 240 and ends with EOX.

Channel Messages

Channel messages come in two types, Channel Voice and Channel Mode. Since the message begins with a status byte, the most significant (left-most) bit is a '1' and it is followed by three more bits specifying the action (more on the next page). The right-most four bits (known as the LSN, or least significant nibble) specify which MIDI channel the message is intended for. As four bits yields 16 separate values (from 0000 to 1111, which MIDI numbers as channels 1–16), channel messages can address 16 separate channels. For a multi-timbral synthesizer, this provides the ability to play 16 separate timbres independently on one instrument or virtual instrument plug-in. For older mono-timbral instruments like the Yamaha DX7, it means you could chain up to 16 instruments with independent note data, controller data and more. In fact, Yamaha came up with a rack-mounted version of eight DX7 sound engines, the TX816 (pictured here set to MIDI channels 1–8), whose modules could share a common MIDI input while each answered to its own channel.

Channel Messages are Voice or Mode:

  • Channel Voice
    Carry the performance data on each of the 16 channels: notes, controllers, program (patch) changes, pitch bend and pressure.
  • Channel Mode
    Define the instrument's response to Voice messages and are sent over the instrument's 'basic' channel.

System Messages

System messages are Common, Real-Time or Exclusive and do not contain specific channel data.

  • System Common
    Messages intended for all connected instruments and devices. Examples include Song Position Pointer, Song Select and the quarter-frame messages of MIDI Time Code.
  • System Real-Time
    Intended for all connected instruments and devices. Each is a single status byte, used mainly to keep devices in sync: the timing clock (24 per quarter note) and Start, Stop and Continue.
  • System Exclusive
    Originally used only for manufacturer-specific data (each manufacturer was given its own ID code), such as the patch dumps exchanged with editor/librarian programs, this class has been expanded with Universal System Exclusive messages for MIDI Time Code, MIDI Sample Dump Standard and MIDI Machine Control. These messages can be as long as needed and are ended by an EOX (End of Exclusive) byte.
Try it

MIDI Monitor Apps

If you use a Mac, a great way to see the actual MIDI bytes being generated is the free MIDI Monitor app from Snoize.com. Windows users can try MIDI-OX, though it may be in need of an update. For a more visual view on Mac, Windows or Linux, there is also the free ShowMIDI.