• 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: dynamically add / remove parameter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamically add / remove parameter


  • Subject: Re: dynamically add / remove parameter
  • From: Ian Kemmish <email@hidden>
  • Date: Mon, 17 Aug 2009 20:31:03 +0100


On 16 Aug 2009, at 23:55, Stefan Kirch <email@hidden> wrote:

what would be the recommended (most elegant without hacking) way of
adding / removing parameters to / from an AudioUnit (Cocoa view)
during runtime, and how do i notify the AudioUnit host about these
changes. Is this possible without having to initialize my AudioUnit
again with a new set of parameters?

My AU is a modular synth where the performance parameters for each voice are defined by the user, and may therefore change every time there's a MIDI program change, so this is a problem that I have to deal with too.



Between your AU and your AU's view you can do anything you want. The difficulty comes when you want the host to take notice of your parameters.


In principle, all you need to do is have your AU start handling the parameter, and then call PropertyChanged with the property kAudioUnitProperty_ParameterList and whatever scope is appropriate. According to my understanding of the AU documentation, this should provoke the host into interrogating my AU for the IDs of an info for all the new parameters. In my case, I call this when a MIDI program change command is received as part of selecting the new voice.

The problem appears to be that, since Apple's documentation doesn't make it explicit that an AU might do this, many hosts assume that the the list of parameters doesn't change (a perfectly reasonable assumption for 99% of all AUs, of course). For example, when I call PropertyChanged as above, GarageBand will dutifully interrogate my AU to get the entire new list of parameters, but then ignore it and continue using the old one.

Re-initialising may or may not help. For example, again with GarageBand, if I switch the software instrument for a track away from my synth and back again, I find that it picks up the different parameter names, but not the fact that there might be more or fewer of them than before!

[GarageBand Stefan, if you're reading this, I was going to mention it, but it's a low priority at the moment.]

MY WORKAROUND for this is to assume that whatever host I am using, it's up to my AU to deal with this. So my AU's user interface is able both to display all the parameters for the current voice, and to bind them all to MIDI controllers. If the user needs automation, then he'll at least be able to automate the MIDI controllers in the host.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ian Kemmish 18 Durham Close, Biggleswade, Beds SG18 8HZ
email@hidden Tel: +44 1767 601361 Mob: +44 7952 854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



_______________________________________________ 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: dynamically add / remove parameter
      • From: Stephen Blinkhorn <email@hidden>
  • Prev by Date: Re: dynamically add / remove parameter
  • Next by Date: Re: dynamically add / remove parameter
  • Previous by thread: Re: dynamically add / remove parameter
  • Next by thread: Re: dynamically add / remove parameter
  • Index(es):
    • Date
    • Thread