Dynamically alter number of plugin parameters?

I thought I had asked this some time ago but I can’t find it in the archives? Is it possible to alter the number of plugin parameters dynamically? I know I can alter the number of my own sliders quite easily but I assume this will render any kind of host automation or midi control useless. The only way I can think of tackling this problem is as follows, and this is purely experimental. I’m thinking of writing a simple plugin that writes the amount of desired parameters to an external/resource. When the plugins instantiates it reads the amount of plugins from this file before any of the parameters are set up. The problem is I would like to be able to change the number of parameters during run time. In order to do this with the previous suggestion wouldn’t I need to remove my plugin from the track and then drop it onto the track again? Would this even work in most hosts? Anyone have any suggestions? I really don’t want to give up host automation.

host automate parameters based on indexes, as long as you keep your index list unchanged it’s ok. thhe list of parameters is updated whenever, each hhosts does it differently there is no method to tell the host “parameter list changed” it’s up to the host. one way is to register all possible parameters with the host, and change that long list, the host knows about all params you just move the ones you use in the places where you want.

if you want to swap parameters on the list, that’s a problem, the index must remain the same

Thanks Atom, that clears up a lot. The only issue with registering all possible inputs is that it leads to a ridiculous list of parameters in the host, even if they are not in use. I’ll try a few tests on popular hosts to see if plugins are freed once they are removed from a track, that would be fine, users could simply reopen the plugin, hence calling it’s constructor again and in turn updating the number of inputs.

just manage your parameter names, unused ones leave empty and those used have named (remember that hosts actually read only 32characters though they could a lot more). this will lead to very funny gingiantic lists of parameters but since there is no better way. Thhough once i thought of one, hosts update parameters whenever they change, if your list change iterate through all the parameters and set to them to the value+0.01 and then value hhost will notice the change and re-read the parameter list. Thhough i did not test this for some reason i can’t remember now why.

From experimenting, it seems that Logic Pro 9 & Logic Pro X only update the names in their automation parameter lists upon construction of the AU plugin. There must be a way to notify the host, or maybe Logic may be calling another AU method that isn't being passed down to the parameter name retreval methods (such as the soon to be deprecated getParameterName()). There must be a way though, since the names in the Reaktor 6 automation parameter list get updated.

I was looking at AudioPluginInstance::refreshParameterList() but I'm not sure how to call it from my plugin processor which inherits AudioProcessor (I'm not even sure if it does what I want).

Looks like this topic is a bit taboo? http://www.juce.com/forum/topic/ni-guitar-rig-can-update-parameter-list-logic9-dynamically-what-about-juce-plugin

There must be some AU event that can be dispatched which would cascade back to the
kAudioUnitProperty_ParameterList event and call GetParameterList (via AUBase.cpp). I'm guessing there's already a juce way to do it, but I haven't found it yet :)

Got it!

AudioProcessor::updateHostDisplay() sends AudioProcessorListener::audioProcessorChanged() to its listeners, which relays

PropertyChanged (kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0);
PropertyChanged (kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0);
PropertyChanged (kAudioUnitProperty_ParameterInfo, kAudioUnitScope_Global, 0);


PropertyChanged (kAudioUnitProperty_PresentPreset, kAudioUnitScope_Global, 0);

to the host, and successfuly updates the names in the parameter list :]


Any way that this can be used to change the plugin name too?