Re: Sysex problems! POSSIBLE COREMIDI BUG
Re: Sysex problems! POSSIBLE COREMIDI BUG
- Subject: Re: Sysex problems! POSSIBLE COREMIDI BUG
- From: "Peter Karlsson" <email@hidden>
- Date: Thu, 03 Jul 2003 18:30:51 +0000
Hi Kurt!
I am using 2 Opcode Studio 4 interfaces. And when I am using your MIDI
Monitor everything works perfect so I can't see why there should be any
problem with the driver.
Here is my MIDIReadProc
static void MyReadProc(const MIDIPacketList *pktlist, void *refCon, void
*connRefCon)
{
int j;
MIDIPacket *packet = (MIDIPacket *)pktlist->packet;
for (j=0 ; j < pktlist->numPackets; ++j)
{
memcpy(sysex_ptr, packet->data, packet->length);
sysex_ptr+= packet->length;
sysexcounter+= packet->length;
packet = MIDIPacketNext(packet);
}
}
I have tried to look in my debugger after the dump is done and I see strange
results. I have also tried to use NSLog in my MIDIReadProc and NSLog reports
exactly the same strange result.
I have also discovered something that really makes me think it's a bug in
CoreMIDI.
If I transmit a sysex dump from my ESQM to my Mac everything works the first
time. The second time I get the wrong result. But if I send a program change
from my Korg Wavestation between 2 ESQM dumps everything works perfect. So
it seems to me that a status flag or something is not working correctly in
CoreMIDI when it receives 2 sysex dumps after each other. The 10 garbage
bytes is always the same as the last 10 bytes of the dump like this:
Example 1
F0 rest of the dump here 00 00 00 00 00 00 00 01 F7 // sysex dump is ok
00 00 00 00 00 00 00 01 F7 F7 // illegal garbage message without status byte
at the start
F0 rest of the dump here 00 00 00 00 00 00 00 01 F7 // sysex dump is ok but
the garbage before this dump makes my sysex counter go wild :-))
Example 2
F0 rest of the dump here 00 00 00 00 00 00 00 01 F7 // sysex dump is ok
Program change (new status byte)
F0 rest of the dump here 00 00 00 00 00 00 00 01 F7 // sysex dump is ok
Very strange...
Peter
From: Kurt Revis <email@hidden>
To: "Peter Karlsson" <email@hidden>
CC: email@hidden
Subject: Re: Sysex problems! POSSIBLE COREMIDI BUG
Date: Thu, 3 Jul 2003 10:35:13 -0700
On Thursday, July 3, 2003, at 06:09 AM, Peter Karlsson wrote:
It seems to be a bug in CoreMIDI!
It could also be a bug in the driver for your MIDI interface. What
interface are you using?
Or, as Chris Reed said, you could have an error in your MIDIReadProc. Can
you show us what yours is doing?
I can't receive 2 sysex dumps after each other without getting 10 garbage
bytes between the 2 dumps. But if I receive for example a program change
after the first sysex dump I can receive a sysex dump in a correct way.
Can someone at Apple or other user on this list confirm this?
I haven't seen this happen. Can you show us the exact sequence of packet
lists that your MIDIReadProc receives? (All of the data in all of the
packets in the packet list.)
Also, do the 10 garbage bytes show up in other apps? For example, take the
project in /Developer/Examples/CoreAudio/MIDI/SampleTools. In Echo.cpp
there are some commented-out lines to print the contents of the MIDIPackets
as they come in -- try uncommenting them and see what the data looks like.
Also, what are the contents of the "garbage"? Is it always the same or
nearly the same, or different every time?
--
Kurt Revis
email@hidden
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
_______________________________________________
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.