Re: Sysex problems!
Re: Sysex problems!
- Subject: Re: Sysex problems!
- From: Doug Wyatt <email@hidden>
- Date: Thu, 3 Jul 2003 15:26:36 -0700
On Thursday, Jul 3, 2003, at 11:30 US/Pacific, Peter Karlsson wrote:
I am using 2 Opcode Studio 4 interfaces.
hmm....
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.
What would be very surprising would be if MIDI Monitor were receiving a
different stream of incoming packets than your application.
I suspect, the reason MIDI Monitor works "perfectly" is that it may be
parsing the incoming messages (as you should be too) and is ignoring
what is syntactically garbage -- data bytes following a system
messages, F7's while not in sysex. Kurt, what *do* you do with garbage
messages?
And what does midiecho print when you uncomment out the printf in its
readproc? It doesn't parse the incoming data.
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);
}
}
Well, you're not doing any parsing and this is likely to cause you
trouble someday ... e.g. if you have a controller that happens to send
a stray pitch bend event every now and then ...
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:
Here's what happens to the MIDI bytes after they leave the ESQM.
They arrive on the Studio 4's MIDI port. A MIDI parser packages them up
into MTP-speak (or not, if you're using it in single-port mode), and
sends them out on the serial cable to the Mac.
Somebody's serial driver runs another MIDI parser (with or without
MTP-speak) to construct MIDIPacketLists, which are passed to
MIDIReceived in the MIDIServer.
MIDIReceived performs *no* parsing of the incoming data, and simply
copies it into shared memory...
I'm wondering about the driver...
Doug
_______________________________________________
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.