Re: Questions on data in MIDIPackets
Re: Questions on data in MIDIPackets
- Subject: Re: Questions on data in MIDIPackets
- From: Doug Wyatt <email@hidden>
- Date: Sat, 9 Feb 2002 07:06:53 -0800
On Saturday, February 9, 2002, at 04:27 , Pete Yandell wrote:
OK, I'm getting down inside MIDI data as it passes through my code, and
I've got a couple of questions which the docs don't seem to answer
clearly. (My favourite line in the docs so far: "The MIDIPacket
contains one or more simultaneous MIDI events. The exception is a
system-exclusive events." :-)
1. Can I assume that an event will never be spread across multiple
MIDIPackets?
Yes, with the exception of system-exclusive events.
Or, putting it the other way around, will I ever get an event that has
a status byte in one packet and some or all of its data in the
following packet?
Only with system-exclusive events.
From MIDIServices.h (I don't *think* this has changed since 10.1.2)
A variable-length stream of MIDI messages. Running status
is not allowed. In the case of system-exclusive
messages, a packet may only contain a single message, or
portion of one, with no other MIDI events.
The MIDI messages in the packet must always be complete,
except for system-exclusive.
If not, what happens with really big SysEx dumps and the like?
They get broken across multiple packets. Since running status is
disallowed, if the first byte of a packet is < 0x80, then you know it's
a sysex continuation.
2. Given that all the data in a single MIDIPacket is supposedly
"simultaneous", does the positioning of real-time events (status codes
0xf8 through 0xff) within the packet matter? Specifically, if a
real-time event occurs within the data of a normal MIDI event, would it
make any difference if the real-time event got moved to elsewhere in
the packet (presuming, of course, that multiple real-time events in the
packet would be kept in order)?
It probably doesn't matter.
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
"The most beautiful thing we can experience is the mysterious. It is the
source of all true art and all science. He to whom this emotion is a
stranger, who can no longer pause to wonder and stand rapt in awe, is
as good as dead: his eyes are closed."
--- Albert Einstein
_______________________________________________
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.