Re: Can you put multiple sysex messages into one large buffer, and use MIDISend()?
Re: Can you put multiple sysex messages into one large buffer, and use MIDISend()?
- Subject: Re: Can you put multiple sysex messages into one large buffer, and use MIDISend()?
- From: Kurt Revis <email@hidden>
- Date: Mon, 21 May 2007 10:06:59 -0700
On May 21, 2007, at 12:06 AM, Stephen Kay wrote:
on 5/21/07 2:54 AM, Stephen Kay at email@hidden wrote:
Sorry if this is a FAQ, I thought I remembered seeing something
about this
somewhere, but I couldn't locate it.
I know you can't do it with MIDISendSysex(), but I was wondering
if you
could put multiple sysex messages into a large buffer, and then
send it in
pieces with MIDISend()?
Probably not, it seems to abort at the first F7. It doesn't hurt
to ask,
though....
It actually does seem to work that way, just sending chunks of a
huge buffer
that has a bunch of different sysex messages in it, without
worrying about
where one starts, and where one finishes.
Any caveats about doing this?
Yes, don't. The docs for the MIDIPacket structure, in
MIDIServices.h, say:
"In the case of system-exclusive messages, a packet may only contain
a single message, or portion of one, with no other MIDI events."
So don't mix sysex data in the same packet as other MIDI data, and
don't put the end of one sysex message in the same packet as the
start of another sysex message.
Depending on who's parsing the contents of that buffer (another app,
a MIDI device driver, or the MIDIServer itself), you might get lucky,
but don't count on it. In practice, sysex is flaky enough even if
you follow the rules, just due to all the weird devices and software
out there -- I don't recommend bending the rules in this case.
--
Kurt Revis
email@hidden
_______________________________________________
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