Add or remove ValueTree parameters while running

Hi, I am working on a plugin in which I want the user to be able to add or remove voices. Every voice has a voice editor with some slider components that I would like to add a valuetree parameter for when the voice is created. However, after initialising the tree.state and trying to add a parameter later on, I get this jassert:

All parameters must be created before giving this manager a ValueTree state

Is there a way to be able to add parameters to a valuetree after setting the AudioProcessorValueTreeState.state? Or would the only workaround be to add a certain amount of parameters beforehand?

Thanks!

I can’t answer specifically as I haven’t used the AudioProcessorValueTreeState class much, but in general it’s not possible to dynamically add new plugin parameters. So it looks like the thing to do in this instance to make sure you have enough to begin with, and then assign them accordingly.

Allright I’ll do that, thank you!