User Tools

Site Tools


simple_midi_specification

Visit www.midi.org for the official midi specifications, but it's all in binary.

Here's an explanation in hex, as that's what's used by midibox.
Also, what I call a 'Command', Midibox refers to as the 'Status byte“. I think 'Command' makes things more understandable.

MIDI Commands in HEX

All Midi commands are higher than 7f Hex (127 decimal, 01111111 binary). They start with 80 Hex (128 decimal, 10000000 binary), which means that a command always has bit 7 set (10000000 binary) and the associated values that follow the command do not have bit 7 set (01111111 binary). This is how midi primarily distinguishes between commands and data.

You don't need to know that to edit the .ini files.

The first byte of all midi commands is divided into the command half and the midi channel half.

NOTE OFF (still in use, for older equipment mainly, now most devices use NOTE ON with velocity = 0 instead)
8X NN VV
8 is the command half for a NOTE OFF
X is the midi channel half - range 0-F (0-15 decimal)
NN is the NOTE NUMBER - range 00-7F (0-127 decimal)
VV is the notes VELOCITY - range 00-7f (0-127 decimal)

NOTE ON
9X NN VV
9 is the command half for a NOTE ON
X is the midi channel half - range 0-F (0-15 decimal)
NN is the NOTE NUMBER - range 00-7F (0-127 decimal)
VV is the notes VELOCITY - range 00-7f (0-127 decimal)
(VELOCITY vaue 0 (zero) is now used for NOTE OFF)

POLYPHONIC PRESSURE (some call it AFTERTOUCH)
AX NN VV
A is the command half for a POLYPHONIC AFTERTOUCH
X is the midi channel half - range 0-F (0-15 decimal)
NN is the NOTE NUMBER - range 00-7F (0-127 decimal)
VV is the AFTERTOUCH AMOUNT - range 00-7f (0-127 decimal)

CONTINUOUS CONTROLLER (CC for short)
BX CC 7F
B is the command half for a CONTINUOUS CONTROLLER
X is the midi channel half - range 0-F (0-15 decimal)
CC is the CONTROLLER NUMBER - range 00-7F (0-127 decimal)
VV is the CONTROLLER AMOUNT - range 00-7f (0-127 decimal)

PROGRAM CHANGE
CX PP
C is the command half for a PROGRAM CHANGE
X is the midi channel half - range 0-F (0-15 decimal)
PP is the PROGRAM NUMBER - range 00-7F (0-127 decimal)

CHANNEL PRESSURE (some call it AFTER-TOUCH)
DX VV
D is the command half for a CHANNEL AFTERTOUCH
X is the midi channel half - range 0-F (0-15 decimal)
VV is the AFTERTOUCH AMOUNT - range 00-7f (0-127 decimal)
Note : Thorsten comments the use of this midi command as 3 bytes.
“D. .. .. (Channel Aftertouch) Example: D0 30 7F @OnOff (MIDIbox sends D0 30 vv)“
This might cause problems with some gear as it should be 2 bytes.
There should be no note associated with this command.
It affects all notes being held down on the same midi channel.

PITCH BEND
EX B1 B2
E is the command half for a PITCH BEND
X is the midi channel half - range 0-F (0-15 decimal)
B1 is the first half of the PITCHBEND AMOUNT - range 00-7F (0-127 decimal)
(refered to as the least significant byte)
B2 is the second half of the PITCHBEND AMOUNT - range 00-7F (0-127 decimal)
(refered to as the most significant byte)
When B1 and B2 are both 40 hex (64 decimal), that is centered, no pitchbend.
Note : Thorsten works this out for you in the firmware, so just use range 0-7F (0-127 decimal)

There are more midi commands, but this should help get you started.

simple_midi_specification.txt · Last modified: 2011/09/17 17:21 by dougster