Table of Contents
See also MIDI clock
- Each MIDI connections can communicate of 16 channels (0-15)
- MIDI devices can switch channels they send messages over.
- Devices listening for message can selectively listen on specific channels, or all channels at once.
# Anatomy of a MIDI message
- MIDI messages are composed of several bytes. Just how many depends on the type of messages
- The first byte is called the
Status Byteand it has two parts, the message type and the channel information.
- Channel info is the four least significant bits
- Message info is the first four bits
- The top most bit is always set. This identifies the first byte as the one containing the message type and channel info.
- The subsequent bytes contain the message data.
- The top bit is unset.
# Note On example
# Status Byte (first byte)
|1 0 0 1||0 1 0 0|
- Top bit is set
- Message type: 9 = Note On
- Channel: 4 = Channel 5
# Data Bytes
|0 0 1 1 1 1 0 0||60||Note|
|0 1 1 1 1 1 1 1||127||Velocity|
- Top bits are unset indicating these are the message values
- 127 is therefore the maximum value
# Note off
- One common way is to use the same message type, but with a value of 0
# Hexadecimal Notation
- Send message bytes using Hex notation, prefixed with
0x. For example,
00111100(60) is sent as
- See also https://kb.iu.edu/d/afdl
https://github.com/gbevin/SendMIDI Send MIDI from the command line.
https://github.com/surfacepatterns/midisnoop Receive and print MIDI messages. Use this in conjunction with sendMIDI to try things out. Uses Alsa or JACK midi drivers. See also Mixxx, Ardour, JACK and MIDI