AudioProcessorParameter redundancies


#1

Hi,

I expect AudioProcessorParameter::setValueNotifyingHost() is forwarding the new value to the host and the host itself calls AudioProcessorParameter::setValue().

Instead my setValue() is called 3 times (VST3):

setValue() is directly called from following call stack:

myParameter::setValue(float)
juce::AudioProcessor::setParameter(int, float) at juce_AudioProcessor.cpp:554
juce::AudioProcessor::setParameterNotifyingHost(int, float) at juce_AudioProcessor.cpp:459
juce::AudioProcessorParameter::setValueNotifyingHost(float) at juce_AudioProcessor.cpp:1322

setValue() is also called from following call stack:

myParameter::setValue(float)
juce::AudioProcessor::setParameter(int, float) at juce_AudioProcessor.cpp:554
juce::JuceVST3EditController::Param::setNormalized(double) at juce_VST3_Wrapper.cpp:241
Steinberg::Vst::EditController::setParamNormalized(unsigned int, double) at vsteditcontroller.cpp:181
juce::JuceVST3EditController::audioProcessorParameterChanged(juce::AudioProcessor*, int, float) at juce_VST3_Wrapper.cpp:551
non-virtual thunk to juce::JuceVST3EditController::audioProcessorParameterChanged(juce::AudioProcessor*, int, float) at juce_VST3_Wrapper.cpp:548
juce::AudioProcessor::sendParamChangeMessageToListeners(int, float) at juce_AudioProcessor.cpp:475
juce::AudioProcessor::setParameterNotifyingHost(int, float) at juce_AudioProcessor.cpp:460
juce::AudioProcessorParameter::setValueNotifyingHost(float) at juce_AudioProcessor.cpp:1322

and finally setValue() is called as expected from following call stack:

myParameter::setValue(float)
juce::AudioProcessor::setParameter(int, float) at juce_AudioProcessor.cpp:554
juce::JuceVST3Component::processParameterChanges(Steinberg::Vst::IParameterChanges&) at juce_VST3_Wrapper.cpp:1872
void juce::JuceVST3Component::processAudio<float>(Steinberg::Vst::ProcessData&, juce::Array<float*, juce::DummyCriticalSection, 0>&) at juce_VST3_Wrapper.cpp:2098
juce::JuceVST3Component::process(Steinberg::Vst::ProcessData&) at juce_VST3_Wrapper.cpp:1930
non-virtual thunk to juce::JuceVST3Component::process(Steinberg::Vst::ProcessData&) at juce_VST3_Wrapper.cpp:1899

For my code a single call is sufficient. Instead I have to add code to avoid redundant reactions. Can this please be corrected!
It seems a paradigm throughout various JUCE code to molest user code with redundant notifications (i.e. the complete nonsense prepareToPlay() sequences).


#2

You need to be able to handle at least two calls - we can’t rely on the host to call setValue.


#3

Thanks, t0m,

I am a bit puzzled what exactly this means to me?

Can I expect you will reduce (if not remove) the redundancies?
(What I see from prepareToPlay() sorry spectacle you don’t really seem care though.)

Should I avoid spending time reporting those bugs?


#4

I’m saying that, in most cases, you will receive at least one “redundant” call. We have absolutely no control over what the host will do so we can’t rely on the host calling setValue in response to your code calling setValueNotifyingHost. This cannot be removed.