r/midi•
bradn

MIDI protocol question (chained note-on commands with no channel selection byte)

Hi, I've dumped a raw midi transmission and I'm dissecting it with a hex editor. I noticed something strange - it is sending midi note on commands like this:

93 42 2f 3d 2f

92 57 2f 57 00 58 2f 58 00 57 2f

Where the 9x bytes are "Note-on" commands for channel x, the following byte is the note number, and then velocity (in this case 2f plays the note, 00 ends the note).

But, I haven't seen anywhere in a midi protocol explanation that says it is legal to chain multiple notes behind a single 9x note-on command. Apparently it must be legal because it works... are there other situations where it is legal to do this??

Thanks

Posted Mar 22, 2015, 6:15 PM UTC

23
djasonic•

I think this is what you are after, from:

http://www.indiana.edu/~emusic/etext/MIDI/chapter3_MIDI4.shtml

To make more efficient use of the limited bandwidth, MIDI manufacturers adopted a shortcut called running status. Running status allows a single status byte's action to remain in effect for an unlimited number of data byte pairs which follow. For example, to play three 'simultaneous' notes on the same MIDI channel, a Note On status byte can be sent, followed by six data bytes.

status(note on, ch 1) key1-velocity key2-velocity key3-velocity To help minimize excessive data by using running status, the note on command can also function to turn notes off by sending a velocity value of zero for the key # to be turned off. so:

status(note on, ch 1) key1-velocity1 key2-velocity2 key3-velocity3 key1-velocity0 key2-velocity0 key3-velocity0

4
bradnOP•

Thanks, that's what I was after - so then it's legal for all command (ahem, status...) bytes to do that.

1
djasonic•

Yes that is what they seem to imply even though all the examples are notes. Control change, pitchbend, aftertouch should all make use of the running (command) status shortcut.

1