AudioProcessorValueTree and custom AudioProcessorParameter classes


#1

When I use the standard AudioProcessorValueTreeState, how can I add parameters that are represented by an extended AudioParameter class? I have a class called ModParamFloat that inherits from AudioProcessorParameter, and I would like to move from a simple XML save/load state to using AudioProcessorValueTreeState, but the only method I can find for adding parameters is createAndAddParameter. Is there no way to just add subclasses of AudioProcessorParameter to the value tree?


#2

No, it wasn’t designed to allow you to do that. But maybe you could get the same result in a different way by getting a Value from the AudioProcessorValueTreeState and then using a custom Value::ValueSource to re-map the value’s range or behaviour somehow.