Re: MIDIPacket
Re: MIDIPacket
- Subject: Re: MIDIPacket
- From: "Vigour Vigour" <email@hidden>
- Date: Tue, 04 Feb 2003 12:56:44 +0000
Hi Kurt!
I see now that you are absolutely right. I did not read the doc properly ;-)
This also means that if I for example have 3 note on messages in a packet
they all have the same timeStamp, right? Like this:
timeStamp, length, note on 1, note on 2, note on 3
And the length in this case is 9. Please correct me if I am wrong.
Best regards Peter
From: Kurt Revis <email@hidden>
To: "Vigour Vigour" <email@hidden>
CC: email@hidden
Subject: Re: MIDIPacket
Date: Tue, 4 Feb 2003 00:15:58 -0800
On Monday, February 3, 2003, at 11:33 PM, Vigour Vigour wrote:
If I look at the documentation for 'MIDIPacket' I can read that:
'a packet may only contain a single message'.
Check that sentence again. It says:
"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 if you send or receive a sysex message, it must start in its own
MIDIPacket. It may extend over multiple packets until it is finished. Each
packet will not contain any other messages.
In every other case--every other MIDI message--there may be multiple
messages in the same packet, and the messages must be completely contained
within the packet.
Does it mean that I can for example have a single note on message like
this:
90 34 56
And nothing more in that packet?
No, you can put other messages in that packet, as long as they aren't
sysex.
If that is the case, why is 'data' declared to 256 bytes?
For convenience. For simple uses, you can just allocate a simple
MIDIPacket and use it without worrying too much about allocating the exact
amount of memory you need. Considering that most MIDI messages are only 3
bytes, 256 bytes is plenty of room to play with.
If you are dong more complicated work, you can allocate the exact amount of
memory you need, and then cast that pointer to a (MIDIPacket *), In
practice, the MIDIPacket structure has variable length--that's why it has a
field stating the length of the data that follws. The 256 byte size only
affects your code at compile time; nothing checks it during run time.
--
Kurt Revis
email@hidden
_______________________________________________
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.