Problems with spurious additional packets in ReadProc
Problems with spurious additional packets in ReadProc
- Subject: Problems with spurious additional packets in ReadProc
- From: Stephen Kay <email@hidden>
- Date: Fri, 05 May 2006 00:08:37 -0400
I'm porting a Classic/OMS App, so I'm new to CoreMIDI, except it looks and
smells a lot like OMS so it wasn't a big leap - Hi Doug. ;-)
But anyway, I'm experiencing some weird behavior, and I'm not sure where to
look.
I'm using a MOTU FastLane, OS X 10.3.9, and the problem is this: When the
keyboard I am using for testing is sending MIDI Clock into the app, playing
notes on it will occasionally result in additional packets received in my
ReadProc. In other words, playing single notes normally yield single calls
to my ReadProc, one for each event (note-on, note-off), and each call has a
packetList with numPackets of 1.
However, if the keyboard is sending MIDI Clock at the same time, I'm getting
some calls to the ReadProc with numPackets 2, and the additional packet
contains a duplicate note-on or note-off.
I tried it with two different keyboards. If I turn off the sending of MIDI
Clock, then this absolutely doesn't happen. So it seems the simultaneous
sending of MIDI Clock is somehow confusing the number of packets or
something.
As it's in the ReadProc from CoreMIDI, and this is just what it's handing
me, I'm not sure what I could be doing to handle this any differently.
I'm just doing this:
static void CoreMIDIReadProc(const MIDIPacketList *packetList, void *refCon,
void *connRefCon)
{
UInt32 numPackets = packetList->numPackets;
MIDIPacket *packet = (MIDIPacket *)packetList->packet;
for (UInt32 i = 0; i < numPackets; i++)
{
// do shit
}
}
Any ideas?
- Stephen
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Stephen Kay
Karma Lab - developers of KARMA
http://www.karma-lab.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden