Re: Stuck MIDI notes
Re: Stuck MIDI notes
- Subject: Re: Stuck MIDI notes
- From: Kurt Bigler <email@hidden>
- Date: Thu, 31 Oct 2002 13:48:01 -0800
on 10/30/02 7:12 PM, Kurt Revis <email@hidden> wrote:
>
On Wednesday, October 30, 2002, at 05:03 PM, Robert Grant wrote:
>
>
> So then I'm confused about why I'm losing the note offs. My code is
>
> to crunch the packets is pretty straightforward:
>
>
>
> MIDIPacket *inPacket = (MIDIPacket *)list->packet; // remove const
>
>
>
> for ( j = 0; j < list->numPackets; ++j) {
>
> if ((inPacket->data[0] & 0x7) == m_channel) {
>
> MusicDeviceMIDIEvent(unit, inPacket->data[0],
>
> inPacket->data[1], inPacket->data[2],
>
> 0);
>
> }
>
> inPacket = MIDIPacketNext(inPacket);
>
> }
>
>
This really isn't enough to parse MIDI correctly.
[snip]
>
You might find it educational to print out all the bytes in each packet
>
as they come in, so you can see this for yourself. And read the MIDI
>
spec... you'll be amazed at how weird things can get.
>
>
--
>
Kurt Revis
>
email@hidden
You might also find it useful to look at Herbie Robinson's midi tester
application (source), available here:
http://sourceforge.net/projects/xmiditest/
The code there does midi parsing, presumably in a complete and correct way.
At least the approach used there has worked for me.
-Kurt Bigler
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.