[sdiy] MIDI running status implementation - status bytes

Andre Majorel aym-htnys at teaser.fr
Fri Jan 31 15:32:38 CET 2014


On 2014-01-31 12:25 +0000, Tom Wiltshire wrote:

> 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?

Tom, your question and Neil's replies leave me slightly
confused.

Why do you say "in the case of channel status bytes" ? Running
status only applies to channel status bytes. From the spec :

  Running Status
    For Voice and Mode messages only, when a Status byte is
    received and processed, the receiver will remain in that
    status until a different Status byte is received.
    Therefore, if the same Status byte would be repeated, it may
    (optionally) be omitted so that only the correct number of
    Data bytes need be sent.  Under Running Status, then, a
    complete message need only consist of specified Data bytes
    sent in the specified order.

    The Running Status feature is especially useful for
    communicating long strings of Note On/Off messages, where
    "Note On with Velocity of 0" is used for Note Off. (A
    separate Note Off Status byte is also available.)

    Running Status will be stopped when any other Status byte
    intervenes, except that Real-Time messges will only
    interrupt the Running Status temporarily.

Voice messages = 0x8x, 0x9x, 0xAx, 0xCx, 0xDx and 0xEx
Mode messages = 0xBx

Regarding "it's quite possible that the new status byte is on
another channel and not meant for us [so] should I update the
current status byte or not ?"...

Suppose you're listening on channel 1 and you receive

  0x90 0x40 0x40
  (running status is now 0x90)
  0x91 0x41 0x41
  (running status is now 0x91)
       0x42 0x42

Had you not updated the running status after receiving 0x91, you
would play note 0x42 even though it's meant for channel 2...

My two cents. I'm no expert.

-- 
André Majorel http://www.teaser.fr/~amajorel/



More information about the Synth-diy mailing list