Music Software Development

MIDI message decoder

Paste MIDI bytes in hexadecimal, from an Arduino serial print, a logic analyser, a MIDI monitor or a SysEx file, and read them as messages. The decoder follows the MIDI 1.0 wire rules: it handles running status, real-time bytes such as clock that arrive in the middle of another message, and System Exclusive. Nothing is uploaded; decoding happens in your browser.

Decoder

6 messages.

Decoded messages (channels shown 1–16)
#BytesMessage
190 3C 64ch 1: Note on C4 (60), velocity 100
290 40 64running statusch 1: Note on E4 (64), velocity 100
390 43 64running statusch 1: Note on G4 (67), velocity 100
490 3C 00running statusch 1: Note off C4 (60) — note on with velocity 0
590 40 00running statusch 1: Note off E4 (64) — note on with velocity 0
690 43 00running statusch 1: Note off G4 (67) — note on with velocity 0

Reading raw MIDI bytes

A byte of 80 or above is a status byte: it starts a message and says what kind it is. Bytes below 80 are data bytes. For channel messages the high four bits of the status are the type and the low four bits are the channel minus one, so 93 is a note on, channel 4. Note on, note off, CC, poly aftertouch and pitch bend have two data bytes; program change and channel aftertouch have one. MIDI messages in bytes lists them all.

Running status

To save bandwidth on the 31,250 baud wire, a sender may leave out a status byte when it is the same as the previous one. In the first example, 90 3C 64 40 64 43 64 is three note-ons on channel 1 with one status byte. Senders combine this with “note on, velocity 0” for note-offs, so a whole chord can play and stop under one status byte. The decoder marks these messages. Running status ends when any other status byte arrives, including SysEx and system common messages, but not real-time messages such as clock (F8), which may appear between any two bytes.

RPNs and NRPNs

Registered and non-registered parameter numbers are set with several CCs: CC 101/100 (RPN) or CC 99/98 (NRPN) choose the parameter, then Data Entry CC 6 and CC 38 set its value. The decoder remembers the last selection on each channel and says which parameter a Data Entry message changes. The second example sets the pitch bend range to 12 semitones; the pitch bend calculator builds these sequences.

Common problems the decoder exposes

For live input from a keyboard, use the monitor in the Web MIDI API tutorial. It uses the same parser as this page.