• 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: Help needed for Audio Unit Parameter Change Notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help needed for Audio Unit Parameter Change Notification


  • Subject: Re: Help needed for Audio Unit Parameter Change Notification
  • From: Brian Willoughby <email@hidden>
  • Date: Thu, 25 Oct 2007 16:36:19 -0700

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


On Oct 25, 2007, at 16:00, Rémi Thébault wrote:

Thank you for your tip Bill

I still have an issue : I've declared mNoteFreq and mNoteHasChanged as private in MyEffectClass::MyEffectClassKernel, so the compiler raise an error when it find them in MyEffectClass::Render().
How should I declare those variable so that I can easily use them both in the Render () and in the Process() functions (and if possible in a nice programmation style)


Sorry for this kind of foolish question
Thanks in advance
Rémi

_______________________________________________
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


  • Follow-Ups:
    • Re: Help needed for Audio Unit Parameter Change Notification
      • From: Rémi Thébault <email@hidden>
References: 
 >Help needed for Audio Unit Parameter Change Notification (From: "Rémi Thébault" <email@hidden>)
 >Re: Help needed for Audio Unit Parameter Change Notification (From: William Stewart <email@hidden>)
 >Re: Help needed for Audio Unit Parameter Change Notification (From: Rémi Thébault <email@hidden>)

  • Prev by Date: Re: Help needed for Audio Unit Parameter Change Notification
  • Next by Date: Re: Help needed for Audio Unit Parameter Change Notification
  • Previous by thread: Re: Help needed for Audio Unit Parameter Change Notification
  • Next by thread: Re: Help needed for Audio Unit Parameter Change Notification
  • Index(es):
    • Date
    • Thread