bayu
October 12, 2022, 2:47pm
2
AudioProcessorValueTreeState::ParameterLayout
You can change the name, but you can’t change the numbers. Because JUCE does not support adding/removing parameter after the construction of the AudioProcessor.
You shouldn’t, really. That pattern is ‘two stage initialisation’ which is easy to get wrong, for example if you forget to signal that the initialisation has been completed.
The APVTS has two constructors: one which takes a ParameterLayout, and one which does not. The one which doesn’t also doesn’t set the state to valid, so you could use that (old) constructor, call createAndAddParameter a few times, and then finally set the state to valid. However, as I said above, this approach is not recomm…
JUCE doesn’t support a dynamic number of plug-in parameters. You can change the names of existing parameters and groups (and hide them in most hosts by giving them an empty name) but changing the number of them won’t work.