Change valueTreeParameters in PluginProcessor at runtime


#1

Hi! Now that I have setted the visibility of the gain slider, I need to change the parameters settings (especially the range and the default value) in the PluginProcessor constructor at runtime.
(I need that if I select an option by a slider, the other sliders attached to the valueTree change in range and default value).
I make an example:

pluginProcessor constructor:

    parameters.createAndAddParameter("lFreq", "Left Frequency", String(), NormalisableRange<float>  (1.0, 22000.0), 1000.0, nullptr, nullptr);

I need to change in runtime the range of the parameter and the default value.
How can I do that?


#2

JUCE and many hosts don’t support you changing the range and default value of parameters. Therefore, I’d strongly advise you not to do this.

Many plug-ins will just keep their parameter’s range between zero and one, for example, and just show something else in their editor - if necessary.