Re: AUMIDIEffectBase Howto
Re: AUMIDIEffectBase Howto
- Subject: Re: AUMIDIEffectBase Howto
- From: "Sophia Poirier [dfx]" <email@hidden>
- Date: Sun, 11 Jan 2009 15:27:30 -0500
Just because a plugin handles note events doesn't mean that it "plays
notes" per se. I have made several AUs that use note events but are
definitely unambiguously effects.
But whether or not this person's particular plugin is better suited as
an instrument, this person has brought up a significant problem with
the current AUMIDIEffectBase implementation, which personally I would
still like to hear addressed.
thanks,
Sophia
On Jan 11, 2009, at 11:08 PM, William Stewart wrote:
If you are doing an audio unit that plays notes (basically a music
instrument/synth/sampler) then you should be using MusicDevicBase as a
starting point and the AUInstrumentBase classes (see SinSynth in the
examples) is a good illustration of this
MIDI Effects are still basically like effects (they process audio) but
just add a layer of control with MIDI that an audio unit can provide a
specific implementation for.
So, I'd recommend having a look at the SinSynth example as a good
start point
Bill
On Jan 9, 2009, at 12:40 AM, Eyal Redler wrote:
Hi,
I'm working on implementing an AUMIDIEffectBase based audio unit.
This is my first venture into Audio Units (and audio programming in
general) and it seems that there are not sample projects for
AUMIDIEffectBase based AU (or maybe there is and I'm not aware of
it) so I'm a bit confused as to how to synchronize the note events
with the audio processing.
When I receive the MIDI event (HandleNoteOn) I get the timing
information in the inStartFrame parameter I understand that this is
relative to the first frame in the next AUEffectBase::Render method,
but if I'm not wrong AUEffectBase may split the buffer into several
parts (which are then passed to the kernel "Process" method) to
accommodate scheduled parameter changes.
This means that inStartFrame can be incorrect relative to the chance
I'm processing in the Kernel. For example, if the buffer size is 512
I may have the following situation:
Frame offset Event
120 Note On
240 Parameter Change
330 Note Off
The parameter change in 240 causes the buffer to be split and then I
have two invocations of the Kernel "Process":
A. Sample 0-239
B. Sample 240-511
And this means that the 330 offset of the Note Off is no longer
valid, I either must adjust it or somehow know what is the real
sample offset I'm processing in the kernel.
Some options that I thought about were:
a. Convert the MIDI notes into parameter changes (how?) and then
have the (very convenient) assumption that each "Process" invocation
is dealing with one note at a time
b. Override AUEffectBase::Render and adjust the MIDI event offsets
c. Enable the Kernel to know what is the real sample offset
(relative to "Render"). I'm not sure how this is done
Thanks,
Eyal Redler
------------------------------------------------------------------------------------------------
"If Uri Geller bends spoons with divine powers, then he's doing it
the hard way."
--James Randi
www.eyalredler.com
_______________________________________________
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