[openbeos-midi] Re: MIDI parser source (bytestream->MIDImessages)

  • From: Christian Packmann <Christian.Packmann@xxxxxx>
  • To: openbeos-midi@xxxxxxxxxxxxx
  • Date: Wed, 28 Jan 2004 20:59:52 +0100

Christian Packmann wrote:
> Matthijs Hollemans wrote:
>> http://cvs.sourceforge.net/viewcvs.py/open-beos/current/src/servers/midi/PortDrivers.cpp

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

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

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

"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. This is referred to as running 
status. Running status is simply a clever scheme to maximize the 
efficiency of MIDI transmission (by removing extraneous Status bytes). The 
basic philosophy of running status is that a device must always remember 
the last Status byte that it received (except for RealTime), and if it 
doesn't receive a Status byte when expected (on subsequent messages), it 
should assume that it's dealing with a running status situation. A device 
that generates MIDI messages should always remember the last Status byte 
that it sent (except for RealTime), and if it needs to send another 
message with the same Status, the Status byte may be omitted."


Other related posts: