Re: Help needed for Audio Unit Parameter Change Notification
Re: Help needed for Audio Unit Parameter Change Notification
- Subject: Re: Help needed for Audio Unit Parameter Change Notification
- From: William Stewart <email@hidden>
- Date: Fri, 26 Oct 2007 19:16:01 -0700
You have to set up all of the files in the param structure - the
elementID is probably garbage, so its not getting through.
On Oct 26, 2007, at 12:11 PM, William Stewart wrote:
Can you try this with the generic view in AULab (/Developer/
Applications/Audio) - you should see your parameter change when the
notification is sent.
On Oct 26, 2007, at 2:23 AM, Rémi Thébault wrote:
Thank you Brian
This help me much
Now I can see more clearly in all the object stuff in CoreAudio.
But it still doesn't work as i would like : i'd like the view (this
is a custom cocoa view) to update in real time (or at least two or
three times /sec) but here my view update only if I reload it (for
example by switching from generic to custom view in AU Lab).
Does anybody knows where could be the problem?
here's the code I use for updating the view
ComponentResult MyEffectClass::Render(...) {
...
SetParameter(kParam_NoteFreq, mNoteFreq);
AudioUnitParameter param;
param.mAudioUnit = GetComponentInstance();
param.mScope = kAudioUnitScope_Global;
param.mParameterID = kParam_NoteFreq;
AUParameterListenerNotify(NULL, NULL, ¶m);
...
}
May be the problem come from the Obj-C code of my view.
Rémi.
Le 26 oct. 07 à 01:36, Brian Willoughby a écrit :
Rémi,
If you define mNoteHasChanged in MyEffectClassKernel, then you
will again have multiple variables, one per channel. What you
want instead is to define mNoteHasChanged in MyEffectClass, so
that Render is checking only a single flag before sending a single
notification.
Another thing you may have missed is that the Constructor for
MyEffectClassKernel (and AUKernelBase as well) is called with
inAudioUnit set to point to MyEffectClass. If you look at the
source for AUKernelBase, in AUEffectBase.h, you'll note that
mAudioUnit is initialized using inAudioUnit. In order for
MyEffectClassKernel to change mNoteHasChanged in MyEffectClass,
you must use mAudioUnit, and cast it to theMyEffectClass * type.
Then, each kernel can reach into the main class to set the flag,
and Render from the main class will have easy access.
You still have the issue that there might be a different pitch on
each channel. You need to design your plugin with this in mind.
Do you want to display the frequency separately for each
channel? ... with the problem that you don't know an absolute
upper bound on the number of channels? ... or do you want to
favor a particular channel or otherwise combine the frequency from
each channel to display only a single frequency - perhaps, only
when they all match?
You choice regarding the above problem will determine whether you
have a single frequency variable in the main class, or multiple
frequency variables for each channel (kernel). If you choose the
latter, you'll need to look around the sample code (AUEffectBase)
for examples of how to enumerate all kernels to collect all the
frequency values into the main render.
Good luck!
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:
@apple.com
This email sent to 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
_______________________________________________
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