IIUC, after creating and adding all desired parameters to an
state instance variable must be set to some valid state, and done so explicitly, e.g.
treeState.state = ValueTree("MyPlugin");.
Otherwise, plugins won’t instantiate correctly, because the state is expected to be a valid one, and
AudioProcessorValueTreeState's default ctor doesn’t initialize it as one. In fact, the
createAndAddParameter method expects the state to be invalid, as commented there:
“All parameters must be created before giving this manager a ValueTree state!”
The thing is, it seems to me that it isn’t clear from the public documentation of
AudioProcessorValueTreeState that the state needs to be set to a valid one, manually, once all the parameters have been added. Doesn’t it make more sense to either a) document it, or better b) provide a public method to call for when you’re done creating parameters which creates a valid state for you, instead of requiring you to modify the
state member? (whose documentation implies you may make additions to it, but doesn’t say that you should modify it).