Re: Sysex problems!
Re: Sysex problems!
- Subject: Re: Sysex problems!
- From: "Peter Karlsson" <email@hidden>
- Date: Fri, 04 Jul 2003 06:12:15 +0000
Hi Doug and Kurt!
I have just tested MIDI Echo and I got exactly the same garbage result. Look
at this.
F0 41 37 00 23 30 01 00 00 00 00 00 01 01 07 04 01 00 02 00 00 0F 07 00 00
00 0C 00 00 00 00 0F 00 08 02 05 02 02 03 02 01 02 03 07 02 0D 02 01 02 05
03 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 01 01 00 00 01 01 07 04 01 00 02 00 00 0F 07 00 00
00 0C 00 00 00 00 09
00 0A 01 03 03 03 03 06 00 0E 02 02 02 0D 02 0A 01 0B 02 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 01 02 00 00 01 01 07 04 01 00 02 00 00 0F 07 00
00 00 0C 00 00 00 00 07 01 02 03 05 02 08 02 09 02 01 02 08 02 07 02 0E 01
0E 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 03
00 00 01 01 07 04 01 00 02
00 00 0F 07 00 00 00 0C 00 00 00 00 0B 00 08 02 00 03 0E 03 02 01 0D 02 0B
02 02 02 07 02 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 01 F7 00 00 00 00 00 00 00 01 F7 F7 F0 41 37 00 23 30 01 00 04 04
00 00 and so on...
I understand that I must use parsing but, this problem must be corrected
first!
Can it be my driver?
Peter
From: Doug Wyatt <email@hidden>
To: Peter Karlsson <email@hidden>
CC: email@hidden, email@hidden
Subject: Re: Sysex problems!
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.
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.