Re: MIDI parser source (bytestream->MIDI messages)

Christian Packmann <[email protected]> Wed, 28 Jan 2004 20:59:52 +0100
Newsgroups gmane.os.openbeos.midi
Message-ID <[email protected]>
Christian Packmann wrote:
> Matthijs Hollemans wrote:
>> http://cvs.sourceforge.net/viewcvs.py/open-beos/current/src/servers/mi=
di/PortDrivers.cpp

> But I think there's a bug, or rather a missing workaround, in the code.=
=20

Have to rectify that. The routine is utterly broken, as far as parsing of=
=20
real-world MIDI streams is concerned.=20

As was mentioned here in November, repeated Note On messages may omit the=
=20
leading status byte. I've found some more information on this, from=20
http://www.borg.com/~jglatt/tech/midispec/run.htm :

"The MIDI spec allows for a MIDI message to be sent without its Status=20
byte (ie, just its data bytes are sent) as long as the previous,=20
transmitted message had the same Status. This is referred to as running=20
status. Running status is simply a clever scheme to maximize the=20
efficiency of MIDI transmission (by removing extraneous Status bytes). Th=
e=20
basic philosophy of running status is that a device must always remember=20
the last Status byte that it received (except for RealTime), and if it=20
doesn't receive a Status byte when expected (on subsequent messages), it=20
should assume that it's dealing with a running status situation. A device=
=20
that generates MIDI messages should always remember the last Status byte=20
that it sent (except for RealTime), and if it needs to send another=20
message with the same Status, the Status byte may be omitted."