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

  • From: Christian Packmann <Christian.Packmann@xxxxxx>
  • To: openbeos-midi@xxxxxxxxxxxxx
  • Date: Sat, 31 Jan 2004 15:25:15 +0100

Matthijs Hollemans wrote:
> Christian wrote:
>> Uhm... bad news: I started coding my parser, and soon realized that 
>> MidiPortProducer::GetData() is utterly broken.
> That doesn't really surprise me. I threw it together pretty quickly, 
> based on something Jerome threw together pretty quickly. It hasn't been 
> tested at all (or just a little), because I have nothing to test it with. 
> I am also not sure whether the routine properly interfaces with the 
> drivers, either.

IIRC Greg Crain got it to work with his MPU401 module, only that the Note 
Offs weren't properly recognized (as his keyboard is using RunningState 
when sending them, this is not surprising). This should mean that it 
basically works. Maybe Greg could test the new version once it's in CVS.

> > I currently don't have time to setup OBOS CVS on my machine, so 
> > somebody else would have to do integration & testing. But I guess 
> > that's preferable to having to write that stuff from the ground up. ;-)
> Sure thing. I'd be happy to integrate your code with the OpenBeOS CVS. 
> Thanks for finding out about this problem.

There's nothing to thank me for - *I* am thankful if I can be of help to 
OBOS. :) 

A draft of the new parser can be accessed at 
Please take a look at it and let me know if coding style and variable names 
are okay. If these have to be changed I'd rather change them in the 
SerialMidiHost sources, so that syncing any later changes would just be 

The code seems to be mostly bugfree, SerialMidiHost works so much that I 
spent the last two days playing with my synth. :) Basic stuff like Note 
On/Off, Control Change, Pitch Bend all works.
I'm not sure if SysEx is properly parsed, and this isn't easy to check, as 
I found no SysEx receive program for BeOS. Guess what my next project is. ;)

Once I'm sure that the code is correct, I'll integrate it into 
MidiPortProducer::GetData() and post the new PortDrivers.cpp.


Other related posts: