There are 2 tables below, one for Channel Messages and the other for System Messages.
All values are shown in hex format unless stated otherwise.
Each MIDI message consists of a status byte (value from 80 to FF) which defines the meaning of the following data bytes.
Most messages consist of a status byte followed by zero, one or two data bytes (each having a value of 00 to 7F).
(n below = 0 to F for MIDI channels 1 to 16)
|8n kk vv||Note OFF||kk=00-7F key|
vv=00-7F release velocity
|9n kk 00||Alternative Note OFF|| |
|9n kk vv||Note ON||kk=00-7F key|
vv=01-7F attack velocity*
|An kk pp||Polyphonic Key Pressure||kk=00-7F key|
pp=00-7F key pressure
|Bn 00 xx||0 - Bank Select MSB* (GS)||xx=00-7F controller value|
|Bn 01 xx||1 - Modulation Depth (GM)|| |
|Bn 02 xx||2 - Breath Control|| |
|Bn 04 xx||4 - Foot Pedal|| |
|Bn 05 xx||5 - Portamento Time (GM)||Glissando Time|
|Bn 06 xx||6 - Data Entry MSB (GM)|| |
|Bn 07 xx||7 - Volume* (GM)|| |
|Bn 08 xx||8 - Balance (GM)|| |
|Bn 0A xx||10 - Pan (GM)||xx=40 for centre|
|Bn 0B xx||11 - Expression* (GM)|| |
|Bn 10-13 xx||16-19 - GP Control #1 - #4|| |
|Bn 20-3F xx||32-63 - Data LSB* for controllers 0-31|| |
|Bn 20 xx||32 - Bank Select LSB (GS)|| |
|Bn 26 xx||38 - Data Entry LSB (GM)|| |
|Bn 40 xx||64 - Hold Pedal #1* (GM)|| |
|Bn 41 xx||65 - Portamento (GS)|| |
|Bn 42 xx||66 - Sostenuto (GS)|| |
|Bn 43 xx||67 - Soft Pedal (GS)|| |
|Bn 44 xx||68 - Legato Pedal|| |
|Bn 45 xx||69 - Hold Pedal #2 || |
|Bn 46 xx||70 - Sound Variation|| |
|Bn 47 xx||71 - Sound Timbre|| |
|Bn 48 xx||72 - Sound Release Time|| |
|Bn 49 xx||73 - Sound Attack Time|| |
|Bn 4A xx||74 - Sound Brightness|| |
|Bn 4B-4F xx||75-79 - Sound Control #6 - #10|| |
|Bn 50-53 xx||80-83 - GP Control #5 - #8|| |
|Bn 54 xx||84 - Portamento Control (GS)|| |
|Bn 5B xx||91 - Reverb Level (GS)|| |
|Bn 5C xx||92 - Tremolo Depth|| |
|Bn 5D xx||93 - Chorus Level (GS)|| |
|Bn 5E xx||94 - Celeste Depth|| |
|Bn 5F xx||95 - Phaser Depth|| |
|Bn 60 xx||96 - Data Increment|| |
|Bn 61 xx||97 - Data Decrement|| |
|Bn 62 xx||98 - Non-RPN* Parameter LSB (GS)|| |
|Bn 63 xx||99 - Non-RPN Parameter MSB (GS)|| |
|Bn 64 xx||100 - RPN* Parameter LSB (GM)|| |
|Bn 65 xx||101 - RPN Parameter MSB (GM)|| |
|Bn 78 00||120 - All Sound Off* (GS)|| |
|Bn 79 00||121 - Reset All Controllers (GM)||Varies between manufacturers,|
but typically Pitch Bend,
Polyphonic & Channel Pressure,
Modulation all set to 0,
Expression set to 7F,
Hold #1, Portamento, Sostenuto
& Soft all set OFF,
|Bn 7A 00||122 - Local On/Off || |
|Bn 7B 00||123 - All Notes Off* (GM)|| |
|Bn 7C 00||124 - Omni Mode Off||responds only to specified MIDI channel|
|Bn 7D 00||125 - Omni Mode On||responds to any MIDI channel|
|Bn 7E mm||126 - Mono Mode On||mm sets the number of|
individual mono sounds available,
typically 0 to 16, default 1
|Bn 7F 00||127 - Poly Mode On|| |
|Other Channel Messages|
|Cn pp||Program Change|| |
|Dn vv||Channel Pressure|| |
|En ll mm||Pitch Bend*||ll=LSB, mm=MSB, each 00-7F|
ll=00, mm=40 for centre
* More on Channel Messages
Note ON attack velocity sets how 'hard' a note is struck (eg how hard a piano key is hit), and should not be confused with other volume level messages.
Depending on how the patch is programmed, this information is often used to change the character of the sound as well as the volume.
For example, a piano key that is pressed gently produces a soft, mellow sound, while the same key pressed hard produced a louder, but also brighter sound.
Controller 0 - Bank Select MSB is used in conjunction often with the Bank Select LSB to select the bank for the next program change message.
This means the patch does not change until the program change is received (bank messages alone are not enough).
The combination of Bank MSB and LSB messages gives a possible 16384 banks, each of 128 different sounds, giving over 2 million possible sounds!
In practice, most manufacturers only use a few different banks, and you can usually ignore the LSB message.
Controllers 7 & 11 - Volume and Expression are often confused.
Some older sound modules do not support Expression.
The intended use is for controller 7 to preset the channel volume, and for Expression to vary volume while notes are played (eg a swell on a brass sound).
If you are writing sequences for a wide range of sound modules, it may be easier to set Expression to 7F (maximum) and use the volume alone for variations.
These volume level messages should not be confused with Note Velocity messages and the GM Master Volume system exclusive message.
Controllers 32 to 63 are provided to give extra resolution to the corresponding controllers 0 to 31.
For example Controller 0 is Bank MSB (most significant byte) and Controller 32 is the Bank LSB (least significant byte).
The only LSB messages which are commonly implemented are listed above separately.
Controllers 64 to 69, and any other control which is switched (meaning that it is either off or on, instead of using a range of values from 00 to 7F), generally interprets values of 00 to 3F as OFF, and 40 to 7F as ON.
For safety, use 00 for OFF and 7F for ON.
Controllers 120 (all sound off) & 123 (all notes off) differ.
All Sound Off is not supported by all modules, and cuts sound off abruptly, while All Notes Off is the same as releasing all notes, so that any notes programmed to have a gradual decay (fade out) after being released, will do so.
Pitch Bend is also affected by the Bend Range set with RPN controllers - see below for more information.
Realtime Parameter Number (RPN) Settings:
These messages specify which parameter is to be set by the following controller 6 (MSB) and 38 (LSB) data messages.
For that reason, it is important to send a RPN reset message after use, so that any 'stray' data messages later in the song do not have undesirable effects.
Non RPN (NRPN) messages are used in different ways by different manufacturers, so you will need to consult the user manuals.
For example, Roland use NRPN message in GS mode to change vibrato, filter and volume envelope settings, as well as fine tuning individual percussion sounds.
Here are some common RPN messages, with the MIDI data shown in bold (and in hex!).
Remember, Bn means a channel controller message on channel n, where n is 0 to F for channels 1 to 16.
Pitch Bend Range
RPN LSB = 0: Bn 64 00
RPN MSB = 0: Bn 65 00
Data MSB: Bn 06 mm (mm sets bend range in semitones
mm can be from 00 to 18 for 0 to 24 semitones both up and down)
Data LSB=0 (usually not required): Bn 26 00
- RPN LSB = 1: Bn 64 01
- RPN MSB = 0: Bn 65 00
- Data MSB*: Bn 06 mm
- Data LSB*: Bn 26 ll
* mm:ll = 00:00 for -1 semitone, 40:00 for no change, 7F:7F for +1 semitone.
- RPN LSB = 2: Bn 64 02
- RPN MSB = 0: Bn 65 00
- Data MSB*: Bn 06 mm
- Data LSB = 0: Bn 26 00
* mm = 28 for -24 semitones, 40 for no change, 58 for +24 semitones.
RPN & NRPN Reset
- RPN LSB = 7F: Bn 64 7F
- RPN MSB = 7F: Bn 65 7F
Send this alone (no data messages) immediately after all other RPN and NRPN messages have been sent.
|F1 vv||MIDI Time Code (MTC)||vv=00-7F for MIDI quarter frame time code value|
|F2 ll mm||Song Position Pointer||ll=LSB, mm=MSB both 00-7F|
|F3 ss||Song Select||ss=song number 00-7F|
|F6||Tuning Request|| |
|F8||Timing Clock|| |
|FA||Song Start|| |
|FB||Song Continue|| |
|FC||Song Stop|| |
|FE||Active Sensing|| |
|FF||System Reset|| |
|F0||Start of Exclusive||followed by a variable amount of data|
|F7||End of Exclusive|| |
More on System Messages
Here's the structure of a system exclusive message:
- Start of Exclusive: F0
- Manufacturer ID: 00-7D, 7E=Universal non-realtime, 7F=Universal realtime
- Device number: 00-0F = dev 1 -16, 7F=all
- Model ID: 00-7F
- 0 or more data bytes
- Checksum: 00-7F (all data + checksum = 0 for lowest 7 bits)
- End of Exclusive: F7
Here are some common system exclusive messages:
- Set GM Mode ON: F0 7E 7F 09 01 F7
- GM Master Volume: F0 7F 7F 04 01 ll mm F7 (ll=LSB, mm=MSB - use 7F 7F for maximum volume)
- GM Master Balance: F0 7F 7F 04 02 ll mm F7 (ll=LSB, mm=MSB - use 00 40 for centre balance)
- Roland GS Mode: F0 41 10 42 12 40 00 7F 00 41 F7
To guarantee a 'clean' start-up on every song, I start my MIDI sequences with a 2/4 bar at 180bpm of MIDI initialisation messages.
The first beat is used for system exclusive messages, and the 2nd beat for the controller messages.
As a double guarantee, I also finish the song with a less stringent reset (importantly, All Note Off messages to catch any stuck notes).
The overall sound of songs will vary between different sound modules due to varying quality of individual sounds, and also due to the different interpretation of 'enhancements' to the General MIDI specification.
The Roland Sound Canvas sound module was one of the first GM modules used commonly by sequenced bands, and is considered as something of a benchmark for song sequences.
Of course, newer modules (including those by Roland) have now surpassed this original module in terms of both sound quality and features.
Use of 'non-GM/GS' controller messages is particularly haphazard between different manufacturers, and bank messages can also be troublesome.
If you are writing sequences for an unknown range of sound modules, my advice is to use only the GM/GS controllers, and to avoid bank messages altogether (don't even send bank 0, because some manufacturers use that bank for the sound module default mode, which is often not even General MIDI, let alone similar patch sounds!).
Initialisation - Start of Every Song
- GM (or GS) mode set
- GM Master Volume
- GM Master Balance
Channel Messages (send on each channel used, preferably on all channels):
- All notes off
- Reset all controllers
- RPN Pitch Bend range
- RPN/NRPN reset
- Program Change (NO Bank Select!)
Check your manual to see which controllers are set by the 'Reset All Controllers' message.
Those listed below should be OK, but you may want to specifically set some or all of them:
- Expression (controller 11) = 7F (hex) or 127 (decimal)
- Pitch Bend = 0
- Channel Pressure = 0
- Modulation (controller 1) = 0
- Hold #1 (controller 64) = 0 (off)
- Portamento (controller 65) = 0 (off)
- Sostenuto (controller 66) = 0 (off)
- Soft (controller 67) = 0 (off)
And reset, at the end of every song (again, on every channel):
- All notes off
- Reset all controllers
- RPN Pitch Bend range (set to default 2 semitones)
- RPN/NRPN reset