Channel messages are the MIDI messages that play the music: notes, controllers, program changes and pitch bend. In a file they are stored exactly as they are sent down a MIDI cable, after the event’s delta time.
Status and data bytes
The status byte’s high four bits are the message and its low four bits the channel,
0 to 15, which people call channels 1 to 16. The data bytes that follow are
00 to 7F. The status byte can be left out when it repeats the
one before: see running
status.
| Status | Message | Data bytes |
|---|---|---|
8n | Note off | key, release velocity |
9n | Note on | key, velocity |
An | Polyphonic key pressure | key, pressure |
Bn | Control change | controller, value |
Cn | Program change | program |
Dn | Channel pressure | pressure |
En | Pitch bend | LSB, MSB |
In a number of the files examined for this site, all from one collection, a bank
select has the value FF (B9 00 FF), a data byte with its top
bit set; perhaps one sequencer wrote −1 for “no bank”. Because the explorer takes two
bytes for a control change whatever they are, it reads on correctly and marks the
byte. A strict reader stops there.
Keys
Keys are numbered 0 to 127, in semitones. Key 60 is middle C, which most software calls C4 and Yamaha calls C3; key 69 is the A above it. On channel 10 in General MIDI each key is a percussion sound instead of a pitch.
Note off
| Byte | Value | Meaning |
|---|---|---|
| 0 | 8n | Note off on channel n |
| 1 | 0 to 127 | The key |
| 2 | 0 to 127 | Release velocity: how quickly the key was let go. Most synthesisers ignore it; 64 is usual. |
Note on
| Byte | Value | Meaning |
|---|---|---|
| 0 | 9n | Note on on channel n |
| 1 | 0 to 127 | The key |
| 2 | 0 to 127 | Velocity: how hard the key was struck, 1 to 127. Velocity 0 means note off. |
Many writers end notes with a note on of velocity 0 instead of a note off, because a
run of note ons can then share one status byte under running status. For example
00 90 3C 64 then 60 3C 00 starts middle C and ends it 96
ticks later.
Pairing notes
The file stores starts and ends, not notes with a length. The explorer’s piano roll pairs them like this:
- A note starts at a note on with a velocity above 0.
- It ends at the next note off, or note on with velocity 0, for the same key on the same channel in the same track.
- When the same key is struck again before it is released, the ends close the notes first in, first out: the oldest note ends first.
- A note still sounding at the end of its track lasts until the track’s last event.
The specification does not say how to pair overlapping notes of the same key; first in, first out is the explorer’s choice, and other programs may close the newest note first.
Polyphonic key pressure
An, then the key and the pressure, 0 to 127: how hard a key that is
already down is pressed, key by key. Also called polyphonic aftertouch. Few keyboards
send it.
Control change
| Byte | Value | Meaning |
|---|---|---|
| 0 | Bn | Control change on channel n |
| 1 | 0 to 127 | The controller number: 0 to 119 are controllers, 120 to 127 are channel mode messages |
| 2 | 0 to 127 | The value |
A few controllers come in pairs for more precision: controllers 0 to 31 carry the high seven bits (MSB) and 32 to 63 the matching low seven bits (LSB). Controllers 64 to 69 are switches, off below 64 and on from 64 (68, legato, reads normal below 64 and legato from 64).
Bank select (0 and 32) followed by a program change chooses a program from a bank. GS, XG and General MIDI 2 use this; General MIDI 1 has a single bank.
Controller numbers
Every number the MIDI Association’s Control Change table defines. The explorer gives each its name and, where the value is more than a position from 0 to 127, says what it means.
| Number | Controller | Value |
|---|---|---|
| 0 | Bank select (MSB) | 0–127, the bank’s MSB |
| 1 | Modulation wheel | 0–127 |
| 2 | Breath controller | 0–127 |
| 3 | Undefined | |
| 4 | Foot controller | 0–127 |
| 5 | Portamento time | 0–127 |
| 6 | Data entry (MSB) | The value of the selected parameter; see Registered parameters |
| 7 | Channel volume | 0–127 |
| 8 | Balance | 0 left, 64 centre, 127 right |
| 9 | Undefined | |
| 10 | Pan | 0 left, 64 centre, 127 right |
| 11 | Expression | 0–127 |
| 12, 13 | Effect control 1, 2 | 0–127 |
| 14, 15 | Undefined | |
| 16–19 | General purpose 1 to 4 | 0–127 |
| 20–31 | Undefined | |
| 32–63 | LSB for controllers 0 to 31 | 0–127 |
| 64 | Sustain pedal | ≤63 off, ≥64 on |
| 65 | Portamento on/off | ≤63 off, ≥64 on |
| 66 | Sostenuto | ≤63 off, ≥64 on |
| 67 | Soft pedal | ≤63 off, ≥64 on |
| 68 | Legato footswitch | ≤63 normal, ≥64 legato |
| 69 | Hold 2 | ≤63 off, ≥64 on |
| 70 | Sound controller 1 | Default: sound variation |
| 71 | Sound controller 2 | Default: timbre / harmonic intensity |
| 72 | Sound controller 3 | Default: release time |
| 73 | Sound controller 4 | Default: attack time |
| 74 | Sound controller 5 | Default: brightness |
| 75 | Sound controller 6 | Default: decay time (RP-021) |
| 76 | Sound controller 7 | Default: vibrato rate (RP-021) |
| 77 | Sound controller 8 | Default: vibrato depth (RP-021) |
| 78 | Sound controller 9 | Default: vibrato delay (RP-021) |
| 79 | Sound controller 10 | No default |
| 80–83 | General purpose 5 to 8 | 0–127 |
| 84 | Portamento control | The source note |
| 85–87 | Undefined | |
| 88 | High resolution velocity prefix | The low seven bits of the next note’s velocity (CA-031) |
| 89, 90 | Undefined | |
| 91 | Effects 1 depth | Default: reverb send |
| 92 | Effects 2 depth | Default: tremolo depth |
| 93 | Effects 3 depth | Default: chorus send |
| 94 | Effects 4 depth | Default: celeste (detune) depth |
| 95 | Effects 5 depth | Default: phaser depth |
| 96, 97 | Data increment, decrement | Value ignored; moves the selected parameter by one |
| 98, 99 | Non-registered parameter number, LSB, MSB | Selects a maker’s own parameter; see NRPN |
| 100, 101 | Registered parameter number, LSB, MSB | Selects a registered parameter |
| 102–119 | Undefined | |
| 120–127 | Channel mode messages |
The explorer shows undefined numbers by number. The names of the sound controllers’ defaults come from RP-021 as listed by the MIDI Association.
Registered parameters
A registered parameter, or RPN, is a setting chosen by number and changed with data entry: select it with controllers 101 (MSB) and 100 (LSB), then send data entry (6 and 38) or data increment and decrement (96 and 97). The selection stays until another is made, so a file should select the null parameter afterwards. Controllers 98 to 101 therefore change the meaning of later data entry messages, and the explorer tracks them: a data entry shows the parameter it is setting, and a pitch bend shows its semitones, using the range most recently set on the channel (2 semitones if none has been).
| MSB | LSB | Parameter | Data entry |
|---|---|---|---|
00 | 00 | Pitch bend sensitivity | MSB semitones, LSB cents |
00 | 01 | Channel fine tuning | 14 bits, 100/8192 of a cent a step; 40 00 is A440 |
00 | 02 | Channel coarse tuning | MSB in semitones; 40 is A440 |
00 | 03 | Tuning program change | MSB: a tuning program (MIDI Tuning) |
00 | 04 | Tuning bank select | MSB: a tuning bank |
00 | 05 | Modulation depth range | MSB semitones, LSB 1/128 of a semitone; defined in General MIDI 2 for GM2, and by makers otherwise |
00 | 06 | MPE configuration | MSB: member channels of the zone, or 0 to end it; defined in the MPE specification |
3D | 00–08 | 3D sound controllers | RP-049; see below |
7F | 7F | Null function | Selects nothing: data entry does nothing until another parameter is selected |
Other numbers are reserved. A pitch bend range set here applies to the channel from then on; the explorer starts each channel at 2 semitones, the General MIDI default.
Data increment and decrement (RP-018)
The value byte of controllers 96 and 97 is ignored. For registered parameters 0 and 1, and for any later one that does not say otherwise, they add or take one from the LSB; for 2, 3 and 4, from the MSB. A device that ignores the LSB of pitch bend sensitivity moves the semitones when the cents reach 100. For non-registered parameters the maker decides. The explorer keeps each parameter’s value per channel (starting from its default) and shows the new value.
3D sound controllers (RP-049)
RPN MSB 3D (61) is reserved for 3D sound controllers; LSBs 0 to 8 are
defined and the rest kept for later ones. Each takes both data entry bytes, a 14-bit
value d from 00 00 to 7F 7F; once the LSB arrives it is
combined with the MSB before.
| LSB | Controller | Value | Default |
|---|---|---|---|
00 | Azimuth angle | −180 + d × 360/16384 degrees; 0 in front, 90 right, −90 left | 40 00, 0° |
01 | Elevation angle | The same scale; 90 above, −90 below | 40 00, 0° |
02 | Gain | (d − 16383)/100 dB, from −163.82 dB to 0 dB in 0.01 dB steps; 00 00 is −∞ | 7F 7F, 0 dB |
03 | Distance ratio | d/16384 of the maximum distance; 7F 7F is 1.0 | 00 10, about 0.001 |
04 | Maximum distance | d × 1000/16384 distance units; 7F 7F is 1000 | 7F 7F, 1000 |
05 | Gain at maximum distance | (d − 16383)/100 dB, −163.83 dB to 0 dB | 51 0F, −60 dB |
06 | Reference distance ratio | (1 + d)/16384: below this ratio no distance attenuation applies | 00 10, 0.001 |
07 | Pan spread angle | The azimuth scale: half the angle of the stereo field | 4A 55, about 30° |
08 | Roll angle | The azimuth scale: rotation of the stereo field about its axis | 40 00, 0° |
The defaults apply after Reset All Controllers and at power on. Gains add to those of channel volume, expression and master volume.
Non-registered parameters
A non-registered parameter, or NRPN, is the same mechanism with controllers 99 and 98 and numbers each maker defines for itself. The explorer shows the number the file selected and the data entry value, without a meaning.
Channel mode messages
Control change numbers 120 to 127 are not controllers but commands to the channel. All of them but 122 and 126 take the value 0, and 124 to 127 also act as all notes off.
| Number | Message | Value |
|---|---|---|
| 120 | All sound off | 0 |
| 121 | Reset all controllers | 0 |
| 122 | Local control | 0 off, 127 on |
| 123 | All notes off | 0 |
| 124 | Omni mode off | 0; also all notes off |
| 125 | Omni mode on | 0; also all notes off |
| 126 | Mono mode on | The number of channels, or 0 for as many as the receiver has; also all notes off |
| 127 | Poly mode on | 0; also all notes off |
Program change
Cn, then one data byte: the program, 0 to 127, the instrument the channel
plays from now on. People and most software number programs 1 to 128, one more than the
stored value; the explorer shows both. C0 51 stores 81, which is program 82,
Lead 2 (sawtooth) in General
MIDI. On channel 10, General MIDI 1 gives program changes no meaning; General MIDI 2
and GS use them to choose a drum
set. In General MIDI 2 a bank select changes nothing until the program change
after it: with bank MSB 78H the channel becomes a rhythm channel playing that drum set,
with 79H a melody channel playing that variation. The explorer follows this per
channel, and names notes on a rhythm channel by the keys of its drum set.
Channel pressure
Dn, then one data byte: the pressure on the whole channel, 0 to 127, the
greatest pressure on any key that is down. Also called aftertouch.
Pitch bend
| Byte | Value | Meaning |
|---|---|---|
| 0 | En | Pitch bend on channel n |
| 1 | 0 to 127 | The low seven bits (LSB) |
| 2 | 0 to 127 | The high seven bits (MSB) |
The value is MSB × 128 + LSB, 0 to 16,383. 8,192 (00 40) is the centre,
no bend. The explorer shows it as −8,192 to +8,191 from the centre and in semitones.
How many semitones the full bend reaches is set by
registered parameter 0;
the explorer takes 2 semitones until the file sets it.