In the MIDI language bits are grouped into units called bytes, as they are in all languages. The bytes in MIDI are 8 bits long.
- Here is an example MIDI byte .... 10010011
What does 8-bit mean?
Because the bytes in MIDI are 8 bits long it is said to be an 8-bit language. Other computer languages are 16-bit (16 bits in a byte) or even 24-bit, 32-bit, 64-bit, or 128-bit. MIDI is 8-bit because compared to many languages it is transmitted relatively slowly (for cost reasons) and therefore needs to be as small as possible to ensure that timing errors do not become noticeable.
What do all the bytes do?
In the MIDI language there are 256 different bytes. Each byte has a specific purpose.
- This example MIDI byte say" "Note On / Channel 2" ... 10010001 (10010000 is channel 1)
- This example MIDI byte says "127" ... 01111111
What are status and data bytes?
MIDI bytes fall into one of 2 categories ...
- Status bytes always start with a 1 and define the type of message being sent.
This is an example status byte ... 10010011 ... which means Note On / Channel 4
- Data bytes always start with a 0 and simply give a value between 0 and 127.
Here is an example data byte ... 01000001 ... which means 65. Because Data bytes always start with a 0 they are restricted to a range of values between 0 (00000000) and 127 (01111111)
What is a MIDI message?
By combining bytes together, MIDI messages are constructed.
There are 2 categories of MIDI message ...
- Channel messages are mostly to do with performance information sent on MIDI channels.
- System messages handle system wide jobs like MIDI Timecode and are not sent on channels.
All MIDI messages are constructed from at least 1 status byte and 1 data byte, often many many more.
Example MIDI message
Here is an example of a simple 3 byte MIDI message comprising a Status byte and 2 Data bytes. This message is telling a sound module set to respond on MIDI channel 1 to start playing a note (C3) at a velocity of 101.