Hi,
I was looking at the new tutorials and really like the new way to access parameter values. Currently I’m using a AudioProcessorValueTreeState and add my parameters with createAndAddParameter(). The only problem I have is that I can’t cast the AudioProcessorParameter* from createAndAddParameter() to a AudioParameterFloat*. I tried static_cast. The cast works, but the value and range are set to zero.
The AudioProcessorValueTree class uses it’s own internal parameter class (AudioProcessorValueTreeState::Parameter) so casting to an AudioParameterFloat will mess things up, all the listener logic etc. These classes are meant to be used separately for different approaches.
I would like to use the new way to access parameters. Like:
AudioParameterFloat* cutoff = new AudioParameterFloat(…);
[…]
filter.setCutoffFrequency(*cutoff);
Right now I call the getRawParameterValue() Function of the AudioProcessorValueTreeState class.