Changing a plugin's parameter from host


#1

Hello long-time Juicers,
I have a newbie question:

Using the provided example ‘Audio plugin host’, I would like to change the parameter of a loaded plugin programmatically, ie from within the code. The plugin in question is Aethereal (free).

Let’s say, i would like to change the parameter called ‘Amp1-Attack’ every 10s, setting it to 1,2,3,4 etc.

How would i go about this? Is the audio plugin host the best example to base my program on? Is there a way to automatically load the plugin at startup?

Thanks for any help!


#2

I think the path you want to go down is finding the corresponding node in the filter graph, then doing

OwnedArray<AudioProcessorParameter>& params = node->getProcessor()->getParameters();

to get the parameters. Once you have these then you can loop over them to find one with a specific name. Finally, in a timerCallback, you would do

params[index_of_param_you_want_to_change]->setValue (normalised_value_you_want_to_set);

To automatically load the plugin you can save the demo host’s state somewhere, then modify the code to always restore that state on startup.


#3

Note: I’ve not actually tested those lines of code, so there may be an error somewhere!