Re: Reading midi events from device
Re: Reading midi events from device
- Subject: Re: Reading midi events from device
- From: Kurt Revis <email@hidden>
- Date: Sat, 14 Oct 2006 00:27:27 -0700
On Oct 13, 2006, at 6:19 PM, Jacob Ole Juul Kolding wrote: Reading the example and some specs I found I think I understand the basic midi messages, but how do I know if I receive a sysex message so I can ignore it?
It's pretty easy. The documentation for MIDIPacket 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.
The MIDI messages in the packet must always be complete, except for system-exclusive.
Look at the first byte of each packet you receive.
== 0xF0: It's the start of a sysex message. There will be no other messages in the packet. Ignore it. <= 0x7F: It must be more data from a sysex message, because all valid messages start with a byte >= 0x80. Ignore it. == 0xF7: This must be the final byte in a sysex message. The packet length should be only one byte. Ignore it. Otherwise: It might be an ordinary message, so pay attention.
That's really all there is to it...
-- Kurt Revis
|
_______________________________________________
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