[sdiy] MIDI running status implementation - status bytes

Ove Ridé nitro2k01 at gmail.com
Fri Jan 31 13:42:13 CET 2014


On 31 January 2014 13:25, Tom Wiltshire <tom at electricdruid.net> wrote:
> Hi All,
>
> Just a quick question about MIDI running status implementation. I read:
>
> "The MIDI spec allows for a MIDI message to be sent without its Status byte (ie, just its data bytes are sent) as long as the previous, transmitted message had the same Status."
>
> From this, you'd assume that each new incoming Status byte would be stored, and would become the new status byte to be used if a message arrives without one. But in the case of channel status bytes, it's quite possible that the new status byte is on another channel and not meant for us.
>
> In this situation,  should I update the current status byte or not?

I don't see see any ambiguity. The status byte (8x-Ex) always comes
with a channel. Any data bytes belong to the last received status.
What I've done in a MIDI project I'm working on is to sort of decouple
the status and data byte logic. Reception of a status byte (8x-Ex)
just sets a "current status" variable (and resets the data byte
counter) and does nothing else. Reception of two consecutive data
bytes triggers a command execution assuming that the "current status"
contains a cupported message and is on a valid channel.

-- 
/Ove

Blog: <http://blog.gg8.se/>

"Here is Evergreen City. Evergreen is the color of green forever."



More information about the Synth-diy mailing list