• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trigger Parameter changes from SetParameter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trigger Parameter changes from SetParameter?


  • Subject: Re: Trigger Parameter changes from SetParameter?
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Sat, 6 Nov 2010 23:11:12 -0600

On 6 Nov 2010, at 20:34, Kevin Dixon wrote:

On Tue, Nov 2, 2010 at 9:21 AM, Kevin Dixon <email@hidden> wrote:
I have a class descending from AUEffectBase. I want to implement a
"Link" mode where one group of parameters depends on another. For
example, two filter's corner frequency will stay the same.

So when you enable "Link", changing Freq1 updates Freq2. I implemented
this by overriding AUBase::SetParameter, essentially like this (psuedo
code)


OSStatus MyAU::SetParameter(AudioUnitParameterID inID, AudioUnitScope
inScope, AudioUnitElement inElement,
Float32 inValue,
UInt32 inBufferOffsetInFrames)
{
if((inID == Filter1Freq) && (GetParameter(LinkEnable) == 1))
{
AUBase::SetParameter(Filter2Freq, inScope, inElement, inValue,
inBufferOffsetInFrames);
}


       return AUBase::SetParameter(inID, inScope, inElement, inValue,
inBufferOffsetInFrames);
}

Is this an "approved" method of doing this? Would it be better to call
the super class first? Any tips appreciated! Thanks,

..but if a user has recorded automation data for that parameter it would over-ride the link?


Personally I'd leave SetParameter alone and implement the link in the DSP code and reflect it in the GUI so when you move the filter 1 slider the filter 2 slider snaps to that value. Also watch out for incoming parameter changes via your event listeners. Or you could just grey the second slider/knob out. That way when you unlink the slider will display the original value.

Hope that helps, bit late here..
Stephen



-Kevin


*bump* _______________________________________________ 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
References: 
 >Trigger Parameter changes from SetParameter? (From: Kevin Dixon <email@hidden>)
 >Re: Trigger Parameter changes from SetParameter? (From: Kevin Dixon <email@hidden>)

  • Prev by Date: Re: Trigger Parameter changes from SetParameter?
  • Next by Date: Re: getting to grips with coreaudio
  • Previous by thread: Re: Trigger Parameter changes from SetParameter?
  • Next by thread: Xcode 3.24 and ppc64 support?
  • Index(es):
    • Date
    • Thread