Re: SetParameter
Re: SetParameter
- Subject: Re: SetParameter
- From: William Stewart <email@hidden>
- Date: Mon, 24 Sep 2007 12:12:36 -0700
On 22/09/2007, at 12:26 PM, Paul Tapper wrote:
Thanks very much for everyone's help on this.
Sophia, the bit in the docs which made me misunderstand about
SetParameter is at http://developer.apple.com/documentation/
MusicAudio/Conceptual/AudioUnitProgrammingGuide/index.html?http://
developer.apple.com/documentation/MusicAudio/Conceptual/
AudioUnitProgrammingGuide/TheAudioUnit/chapter_4_section_4.html and
is as follows:
SetParameter, from the AUEffectBase class, takes just two method
parameters—the ID of the parameter to be changed and its new value—
and not only adjusts the parameter but also notifies listeners of
the change.
No - this is incorrect. You can have a look at the code: in
AUEffectBase::SetParameter all that it does is call through to the
SetParameter calls in AUBase (providing a default GlobalScope and
El==0) These calls do not do notifications either (as I've described
in previous emails)
So, if the documentation does indeed say this, it is wrong (we'll
check that)
Maybe I'm just misunderstanding what this is saying because I'm new
to AudioUnits...?
Anyway, in case its helpful to anyone else, I have eventually
gotten this working (benefiting from everyone's help here) with the
following code:
AudioUnitParameter changedParam;
changedParam.mAudioUnit = FindMatch(this);
changedParam.mParameterID = paramID;
changedParam.mScope= kAudioUnitScope_Global;
changedParam.mElement = 0;
AUParameterSet(NULL, NULL, &changedParam, value, 0);
Yes - but I want to just be clear. Your Audio Unit implementation
should *not* be making this call. Rather the code that is calling
AudioUnitSetParameter should be making this call (AUParameterSet)
instead. From the previous description, I think this would be your
custom view that needs to make this change.
Thanks
Bill
Thanks again.
Paul
> From: email@hidden
> Date: Fri, 21 Sep 2007 19:59:38 -0700
> To: email@hidden
> CC: email@hidden
> Subject: Re: SetParameter
>
> And to add to this:
>
> AUEffectBase::SetParameter is the call that is made in your AU in
> response to someone using your AU and calling AudioUnitSetParameter
>
> We do not expect that the audio unit itself notify listeners of
> changes to the parameter values. Rather the code that is calling
this
> API should do so. So I think in this case the problem is that your
> view is just calling AudioUnitSetParameter when it should be calling
> AUParameterSet that will itself do two things:
> Call AudioUnitSetParameter on your AU to set the value of the
parameter
> Call the notification mechanism to tell other listeners that the
> value of this parameter has changed.
>
> HTH
>
> Bill
>
> On 20/09/2007, at 9:07 PM, Sophia Poirier [dfx] wrote:
>
> > What in that document leads you to believe that
> > AUEffectBase::SetParameter() is supposed to notify listeners? I
> > don't see anything that says anything like that, but maybe I'm not
> > catching something in there.
> >
> > At any rate, what Eric told you and you've found are correct: that
> > AUEffectBase::SetParameter() will not post notification.
> > AUParameterSet() will (in addition to setting the value for the
> > parameter), or alternately you can use AUParameterListenerNotify()
> > to only post a change notification without setting a value.
> >
> > Sophia
> >
> >
> >
> > On Sep 19, 2007, at 10:19 AM, Paul Tapper wrote:
> >
> >> Thanks for the help.
> >>
> >>
> >> I am calling AUEffectBase::SetParameter(paramID, value); which
the
> >> Audio Unit Programming Guide seems to suggest would then notify
> >> the listeners (which would presumably include the host - see
> >> http://developer.apple.com/documentation/MusicAudio/Conceptual/
> >> AudioUnitProgrammingGuide/index.html?http://developer.apple.com/
> >> documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/
> >> TheAudioUnit/chapter_4_section_4.html)
> >>
> >> But, for me, AUEffectBase::SetParameter just seems to call
> >> AUElement::SetParameter which doesn't seem to feed through into
> >> AUParameterSet anywhere. Maybe I'm just using this wrong somehow.
> >>
> >> Paul
> >>
> >>> Use AUParameterSet to set an AudioUnit parameter value and
notify
> >>> listeners.
> >>>
> >>>
------------------------------------------------------------------
> >>> Eric Eizenman
> >>> BIAS Inc., Audio Software Development
> >>>
------------------------------------------------------------------
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Coreaudio-api mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
40apple.com
> >
> > This email sent to email@hidden
>
> --
> mailto:email@hidden
> tel: +1 408 974 4056
>
______________________________________________________________________
__
> __
> "Much human ingenuity has gone into finding the ultimate Before.
> The current state of knowledge can be summarized thus:
> In the beginning, there was nothing, which exploded" - Terry
Pratchett
>
______________________________________________________________________
__
> __
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
40hotmail.com
>
> This email sent to email@hidden
Do you know a place like the back of your hand? Share local
knowledge with BackOfMyHand.com
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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