Re: Audio Unit input pitch based MIDI output
Re: Audio Unit input pitch based MIDI output
- Subject: Re: Audio Unit input pitch based MIDI output
- From: Camille <email@hidden>
- Date: Thu, 28 Dec 2006 14:44:32 +0100
Hi Franck,
I have been asking myself this question too:
How to make an AU that takes an audio input, and no audio output?
I guess you have a output samples anyway, and there is no problem as
long as you forward the data with no processing, and send the MIDI
events on the side.
To answer your questions:
On 27 déc. 06, at 19:30, Frank Schoep wrote:
I'd really appreciate it if you could explain to me how to
implement the MIDI part of an Audio Unit that generates MIDI notes
based on audio input. I'm thinking about something like this:
1 - in the AU constructor: create a MIDI "device" or "output" so
that other applications (and Audio Units like DLSMusicDevice) can
see my AU as a MIDI source
Yes, create a virtual MIDI source (MIDISourceCreate).
For that you have to instantiate a MIDI client first (MIDIClientCreate).
Your AU will act then as a MIDI source, from which other MIDI clients
can connect and receive events.
You should consider the case where multiple instances of your plugin
are running together. In MIDISourceCreate, you give a name to the
virtual source, but this name should remain the same so that other
client can reconnect to it later. At the same time if every sources
you create are named the same, then how will it be possible to
identify the right plugin? This is not very important, because
you'll have multiple copies of the same input name, but it could
confuse the user, I think.
2 - while processing: send MIDI events at the moments a note should
be played
Here you have to use build a packet list and call MIDIReceived() in
order to tell CoreMIDI what is the data you want to send from the
virtual source. All the functions to build packet lists are
available in CoreMIDI, this is very easy to do.
3 - in the AU destructor: clean up the MIDI "device" or "output"
Just clean up the objects you instantiated with CFRelease, that is
the midi client and the virtual source.
All the best,
Camille
_______________________________________________
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