Hexadecimal Representation of MIDI Note On Messages
This article provides an overview of the hexadecimal structure used in a standard Musical Instrument Digital Interface (MIDI) Note On message. It breaks down the standard three-byte sequence—the status byte, the note number, and the velocity value—explaining the specific role and hexadecimal range of each byte along with practical examples for implementation.
A standard MIDI Note On event is a channel voice message made up of three successive bytes, formatted as:
9n kk vv
Byte 1: The Status Byte
(9n)
The status byte indicates the action to be performed and the MIDI channel it applies to.
- Command Nibble (
9): The first nibble (the most significant 4 bits) is always9, which defines the message as "Note On." - Channel Nibble (
n): The second nibble specifies the MIDI channel from 0 to 15 (representing Channels 1 to 16 in hexadecimal). - Hex Range:
0x90to0x9F(where0x90corresponds to Channel 1 and0x9Fcorresponds to Channel 16).
Byte 2: The Note Number
(kk)
The second byte identifies the pitch of the note being played.
- Range: MIDI notes range from 0 to 127 in decimal.
- Hex Range:
0x00to0x7F. - Example: Middle C (MIDI note 60) is represented as
0x3C.
Byte 3: Velocity (vv)
The third byte indicates how hard the key was struck, which usually controls volume or timbre.
- Range: Velocity values range from 0 to 127 in decimal.
- Hex Range:
0x00to0x7F. - Special Case: A velocity of
0x00is defined by the MIDI specification as a "Note Off" command for that specific pitch, allowing instruments to release the note without sending a separate Note Off status byte (0x8n).
Practical Example
To trigger Middle C (note 60) on MIDI Channel 1 at maximum velocity (127):
- Status Byte:
0x90(Note On, Channel 1) - Note Byte:
0x3C(Note 60 / Middle C) - Velocity Byte:
0x7F(Velocity 127)
The complete hexadecimal message transmitted across the MIDI line is:
90 3C 7F.