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

"Matthijs Hollemans" <[email protected]> Tue, 27 Jan 2004 13:59:31 +0100
Newsgroups gmane.os.openbeos.midi
Organization All Your Software
Message-ID <01ba01c3e4d5$68333820$2101a8c0@sputnik>
Hey Christian,

> any hints where I can find source code which takes a raw byte stream
> and parses it into MIDI messages?

The midi_server does something like that already. The code is in
PortDrivers.cpp. It appears to work on at least some systems, but it is n=
ot
finished yet. The code to split the raw bytes into MIDI message is actual=
ly
pretty simple:
http://cvs.sourceforge.net/viewcvs.py/open-beos/current/src/servers/midi/=
PortDrivers.cpp

There is also supposed to be a midi_parser kernel module, but this is onl=
y
intended to be used by device drivers. I don't know how it works, or whet=
her
we already have it in the OpenBeOS CVS.

> [...] there already is serial_midi, but it only does MIDI-Out, not
MIDI-In,
> and this isn't acceptable.

Hmm, I didn't know that. You could always write a replacement driver for
serial_midi, of course :-) Then the midi_server will take care of parsing
the raw byte stream.

Hope this helps,
Matthijs