Re: Elementary CoreMIDI problem
Re: Elementary CoreMIDI problem
- Subject: Re: Elementary CoreMIDI problem
- From: Kurt Revis <email@hidden>
- Date: Wed, 30 Mar 2005 11:20:03 -0800
On Mar 30, 2005, at 3:16 AM, David DURIEUX wrote:
Contrary to what the rest of this email may imply, I'm not a complete
idiot, I am, however, a complete novice to both Apples and CoreMIDI.
My colleague and I are trying to start a small project but we are
stuck on some elementary problems. Previous posts direct people's
attention towards the example echo.cpp, but, this application crashes
whenever we run it on our system.
What is the backtrace when it crashes?
The application crashes only when a midi keyboard is connected to the
system. I know the keyboard is continually sending out null midi
messages.
What is a "null" MIDI message? I've never heard of that before. Do
you mean an active sense message (0xFE)?
To me this seems as though the IAC bus is acting as a loopback
device, and copying the output back to the input again creating a huge
queue of messages which are using all the systems resources. Does the
IAC bus act as a loopback device?
The IAC bus doesn't act as a loopback by itself. It merely takes the
data sent to its destination endpoint (by one app) and makes it appear
to have come from its source endpoint (which other apps may be
listening to).
The problem is what echo.cpp does. It takes input from all available
sources, and sends the data back to one destination. If that
destination is the IAC bus, then it will get that data back again as
input, and send it again, and so on. I see how this could cause
problems.
In a real app, you would want to make sure that you don't make a loop
like that (and it would probably be difficult to do it by accident).
echo.cpp was written long before the IAC bus existed, so it isn't doing
anything smart to avoid the loop.
Note that you can turn off the IAC bus in Audio MIDI Setup. "Show
Info" on it, and uncheck "Device is online".
Secondly, I am still very confused about how messages can be moved
from destination to source. The example only shows how to connect
several sources to an input and send the messages to a destination.
The only thing I can think of is that, because sources and
destinations are both MIDIEndpointRef's that they may be used
interchangeably, but this has not worked either.
Can you give an example of exactly what you want to accomplish?
The IAC bus is one way to do this. Another would be to make two
virtual endpoints: a virtual destination and a virtual source. When
you receive data from the virtual destination, take the same data and
"send" it out via the virtual source. See MIDIDestinationCreate(),
MIDISourceCreate(), and MIDIReceived().
I am sure this question has been asked before, but I would be very
grateful if someone can lend an explanation or some example code, as
documentation for CoreMIDI seems surprisingly thin.
Generally the best documentation is in MIDIServices.h itself
(unfortunately).
Pete Yandell also has some MIDI code here:
http://pete.yandell.com/software/
--
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