• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reading midi events from device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
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

References: 
 >Re: Reading midi events from device (From: "Jacob Ole Juul Kolding" <email@hidden>)

  • Prev by Date: Re: Reading midi events from device
  • Next by Date: Callback when AUFilePlayer is finished?
  • Previous by thread: Re: Reading midi events from device
  • Next by thread: Callback when AUFilePlayer is finished?
  • Index(es):
    • Date
    • Thread