• 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: AU MIDI out
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AU MIDI out


  • Subject: Re: AU MIDI out
  • From: Doug Wyatt <email@hidden>
  • Date: Tue, 19 May 2009 14:38:28 -0700


On May 19, 2009, at 1:55 , Brian Willoughby wrote:


On May 13, 2009, at 02:05, Costas Calamvokis wrote:
I also noticed that the SinSynthWithMidi.cpp example that comes with
the SDK appears to be broken. The midi sending looks wrong:

Byte data[4] = {item.status, item.channel, item.data1, item.data2};

Shouldn't the channel be part of the the status byte and the message
be only 3 bytes long?


You're thinking only of classic MIDI. In USB-MIDI, the status is repeated in the meta information that was added by that specification, but the channel is not repeated. Every USB-MIDI message consists of four bytes, arranged as three classic MIDI bytes plus a new USB-MIDI meta byte to bring the total to four. For modern applications, it makes sense to maintain status and channel separately until it is actually sent over the MIDI interface, for better support of USB-MIDI (which is now more prevalent, I'd assume, than classic MIDI).

By the way, in an ideal world, the committee which designed USB-MIDI might have consulted with the MIDI Manufacturers Association and avoided this useless, confusing, and bug-prone duplication of the status bits. I've already seen open-source code where USB-MIDI firmware incorrectly set the status to different values in the same message. Software which receives messages from this particular open- source has the dilemma of whether to trust the classic status or the meta status as being correct when they differ. In light of the potential for such mismatches, I think that the Apple sample code actually sets a good example, where the status is maintained separately until the last minute, where it can then be stuffed into both places to be sure it matches.

Brian, sorry, no, the MIDIPacketList structure has absolutely nothing to do with USB-MIDI. The example code quoted above is incorrect.


Doug

_______________________________________________
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: 
 >AU MIDI out (From: Costas Calamvokis <email@hidden>)
 >Re: AU MIDI out (From: Brian Willoughby <email@hidden>)

  • Prev by Date: Re: AU MIDI out
  • Next by Date: Re: AUGraph stopped calling rendercallback
  • Previous by thread: Re: AU MIDI out
  • Next by thread: Re: AU MIDI out
  • Index(es):
    • Date
    • Thread