Hello to the JUCE team !
Finally, in 2018, I have decided to give a go to the class AudioProcessorValueTreeState, to implement audio plug-ins parameters in my main AudioProcessor class
So, as I have understood their operating mode, to use one you have :
- to put it as a public member of the AudioProcessor
- to declare your parameters using the function “createAndAddParameter”
- to initialize the state member as a ValueTree with a given name
Here are my first questions :
- It is stated that you need to provide some lambda functions in the createAndAddParameter function if you want to customize the way the processor converts value to text and vice versa, otherwise the class uses the default implementation. I have observed that if you provide nullptr there and say a given NormalisableRange just before, the DAW only displays the values of the parameters as floats between 0 and 1, even if I provided say a NormalisableRange with values between - 40 and +40. Wouldn’t it make some sense to replace line 74 in juce_AudioProcessorValueTreeState.cpp the instruction
AudioProcessorParameter::getText (v, length);with
: AudioProcessorParameter::getText (range.convertFrom0to1(v), length);, so that what I did before allows me already to display the correct values in the DAW, using the information I have already provided ?
- Let’s say I want that my parameters change the value of a flag called “mustUpdateParameters” when they are changed, by the user from the UI, or using automation. How can I do that ? Should I make my AudioProcessor class herit from AudioProcessorValueTreeState::Listener and call “state.addParameterListener(strID, this)” in the constructor for every single parameter, or there is something faster that I have not seen yet ?
- How I can get the unnormalised value of a parameter from the AudioProcessorValueTreeState ? Do I need to use getText(), the conversion lambdas if I provided one, or something else ?
Thanks in advance !