Re: AU MIDI out
Re: AU MIDI out
- Subject: Re: AU MIDI out
- From: Brian Willoughby <email@hidden>
- Date: Tue, 19 May 2009 01:55:50 -0700
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 Willoughby
Sound Consulting
_______________________________________________
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>) |