Re: CoreMIDI behavior?
Re: CoreMIDI behavior?
- Subject: Re: CoreMIDI behavior?
- From: Kurt Revis <email@hidden>
- Date: Mon, 7 Jan 2002 02:31:59 -0800
Just wanted to ask a question or two about current/future behavior of
the CoreMIDI framework with regard to a MIDIReadProc().
I don't know the answers to these questions, either, but I thought I'd
chip in some observations:
Excluding SysEx, so far I've noticed that I only get full MIDI messages
in the call back (status byte + 1/2 data bytes). Usually one per
packet but sometimes two. Either way, it's always whole messages, i.e.
no fragments.
I'm making this assumption too--I'm pretty sure that's how it's intended
to work.
(Somewhat tangentially: If you take a look at the MIDI over USB
specification, you'll find that their idea of "packet" maps quite
closely to what you see in CoreMIDI's packets.
http://www.usb.org/developers/data/devclass/midi10.pdf
Reading this and the sample USB MIDI driver code, especially
/Developer/Examples/CoreAudio/MIDI/SampleUSBDriver/Shared/USBMIDIDriverBase.
cpp, helped me understand what was going on a little better.)
One other notable exception might be real-time SysEx messages. What
happens with them?
I don't see why these would be handled any differently than other SysEx
messsages. The transport mechanism shouldn't care about them.
Also, running status is not supported in the MIDISend() function but
does CoreMIDI do anything with running status on the inputs? Does it
add the status byte for me or do I need to watch out for running
status? If the status byte is not added, does that my break my above
assumption that packets will always contain complete messages?
I figure that running status should be treated as, essentially, a method
of data compression. Since physical MIDI is so slow, it's by far the
bottleneck, and it's really the only place where it's worth going to so
much trouble to save one lousy byte per event. So I am assuming that
the MIDI interface hardware (or perhaps the driver) will transparently
compress and uncompress using running status. I have no idea if this
really happens, since I don't have any hardware which will let me see
what exactly is on the wire, but it seems like the only sane way to do
things.
As usual, someone please correct me if I'm wrong about any of this.
--
Kurt Revis
email@hidden