Search Topic
Guide to Basic MIDI Messages for Programmers
MIDI is a musical description language in digital binary 1 or 0 form.
The basic MIDI message consist of 2 or 3 “data byte” which includes Status bytes and Data bytes.
A MIDI message is made up of an 8 bit status byte which is generally followed by one or two data bytes.
- Status byte
- The most significant bit of status byte is set to 1.
- Next 4 bits identify which channel it belongs to (4 bits can produce 16 channels numbered from 0 to 15 in hexadecimal.).
- Data byte
- The most significant bit of data byte is set to 0.
A three data bytes long midi message contains a status byte followed by two data bytes. MIDI message is a 8 bit language ; the bytes in MIDI are 8 bits long. Here is an example of a simple 3 byte MIDI message.
Basically the two important midi messages are the NOTE ON and NOTE OFF messages.
When a musician press a key on the music keyboard the NOTE ON message is sent. It contains parameters to specify the pitch of the note as well as the velocity (intensity of that perticualr note when it is pressed).
Hexadecimal notation is commonly used to describe MIDI messages. Here in above example, the three-byte message indicates a Note On event on Channel 1 followed by Note number C3 with Velocity 125.
The first Status byte Note-Off event will be 1000 with channel 1 (i.e Ox8O). There are a total of 16 channels available 0000 to 1111.
The first data byte indicates the note number, which indicates, what note has been played by the musician.
The second data byte indicates the velocity at which the key was pressed. The velocity measure with values in between 0 to 127.