Microtonal, just intonation, electronic music software Microtonal, just intonation, electronic music software
Login   |  Site Map

the pitch bend archive

2005-08-24 at 17:00

MIDI Messages

As I previously mentioned (see MIDI Ports), MIDI is a message-based control protocol. MIDI messages commonly have at least one COMMAND byte and may have zero or more DATA bytes. The purpose of this article is to introduce you to the MIDI message formats and contents. Generally speaking, we can categorize MIDI messages into the following categories.

Channel Messages

Channel messages are the primary messages used for controlling synthesizers and for receiving input from MIDI controllers. Channel messages require two or three bytes, depending on the specific message. The first byte is always divided into two nibbles (4-bits). The first nibble contains the message number, and the second nibble contains the channel number. Channels have a value between 0 and 15. Here's an example of a note-off message in hexadecimal format: 83 3D 79. The first byte (83) specifies the note-off message because the first nibble equals 8. The second nibble (3), specifies that the command will be sent to MIDI channel 3. The 2nd byte (3D) specifies the MIDI key number, and the 3rd byte specifies the MIDI velocity. Here's a summary of the MIDI channel messages. Note in the following table, cccc represents a nibble used for specifying the MIDI channel number.

Message NameByte 1Byte 2Byte 3Example
Note Off1000 ccccThe MIDI key specifies the number of the key or note to release.The velocity specifies how quickly the note-release is effected.83 3D 79 turns note 3D (decimal 61) on channel 3 off with a velocity of 79 (decimal 121).
Note On1001 ccccThe MIDI key specifies the number of the key or note to turn on.The velocity specifies how quickly or forcefully the note is struck.94 3D 79 turns note 3D (decimal 61) on channel 4 on with a velocity of 79 (decimal 121).
Polyphonic Aftertouch1010 ccccThe MIDI key number.The key pressure value.A0 3D 5A changes the pressue for note 3D (decimal 61) on channel 0 to a value of 5A (decimal 90).
Control Change1011 ccccThe controller number
[0 - 119]
The controller value
[0 - 127]
B3 10 7F sets the value of controller number 10 (decimal 16) to 7F (decimal 127).
Program Change1100 ccccThe new program (patch) number.-- n/a --C3 44 changes the program number for MIDI channel 3 to 44 (decimal 68).
Channel Pressure (Aftertouch)1101 ccccThe single greatest pressure value of all depressed keys.-- n/a --D3 44 changes the channel-pressure for MIDI channel 3 to 44 (decimal 68).
Pitch Wheel Change (Pitch Bend)1110 ccccLeast significant 7-bits of pitch-bend value.Most significant 7-bits of pitch-bend value.E1 70 37 sets the pitch-bend for channel 1 to a value of 03F8 (decimal 1016).

System-Exclusive Messages

The system-exclusive (SysEx) message is just a message-shell for transporting data and commands that are not supported by the MIDI specification. Generally speaking, controller and synthsizer manufactuers use the SysEx shell for providing proprietary extensions for their own equipment. Furthermore, since the original MIDI specification was so limited in its ability to expand and provide new features, there are now a number of standard SysEx messages defined within the MIDI specification for supporting extended features such as the MIDI Tuning Specification (MTS). Such extensions are the so-called Universal Exclusive Messages.

Each SysEx message begins with two data bytes F0 (1111 0000) and 0iiiiiii, where iiiiiii is a manufacture's code. Presumably, each equipment manufacturer has its own unique code and this code is used by the equipment to filter-out messages. Presumably, equipment only responds to messages with the correct manufacture's code. There is, however, nothing the prevents equipment or software from processing any of the SysEx messages. After the two header bytes comes a string data bytes. Remember that MIDI data bytes are allowed to range between 0 and 127. The most-significant bit of each MIDI data byte must equal 0. The SysEx message is terminate when the byte value F7 (1111 0111) is encountered.

System-Common Messages

System-common messages are a hodge-podge of messages that are used for purposes other than controlling MIDI voices and channels. All System-common messages like the System real-time messages have the first nibble of the first byte equal to F (i.e., 1111).

Message NameByte 1Byte 2Byte 3
System ExclusiveF0
(1111 0000)
The manufacture's unique identifier.-- n/a --
ReservedF1
(1111 0001)
-- n/a ---- n/a --
Song Position PointerF2
(1111 0010)
Least significant 7-bits.Most significant 7-bits.
Song SelectF3
(1111 0011)
The song or sequence to be played.-- n/a --
ReservedF4
(1111 0100)
-- n/a ---- n/a --
ReservedF5
(1111 0101)
-- n/a ---- n/a --
Tune RequestF6
(1111 0110)
-- n/a ---- n/a --
System Exclusive ENDF7
(1111 0111)
-- n/a ---- n/a --

System Real-Time Messages

System real-time messages are those messages that are system-wide in nature and are used controlling the sequencer in real-time. Like the System-common messages, the real-time messages all use the MIDI-message address space that's defined with the first nibble value of F (1111).

Message NameByte 1Byte 2Byte 3
Timing ClockF8
(1111 1000)
-- n/a ---- n/a --
ReservedF9
(1111 1001)
-- n/a ---- n/a --
StartFA
(1111 1010)
-- n/a ---- n/a --
ContinueFB
(1111 1011)
-- n/a ---- n/a --
StopFC
(1111 1100)
-- n/a ---- n/a --
ReservedFD
(1111 1101)
-- n/a ---- n/a --
Active SensingFE
(1111 1110)
-- n/a ---- n/a --
ResetFF
(1111 1111)
-- n/a ---- n/a --

MIDI Software Related Articles