juce_VST3_Wrapper setting value to 0

— edit (solved i guess):

when working with “raw” juce::AudioProcessorParameters the setValue() function can not be called from the GUI in a plugin build, but only setValueNotifyingHost(), so that the host doesn’t try to set the value back immediatly

— old post:

hey. ok it’s the following situation:

i wanted to make my own inherited class from juce::AudioProcessorParameter in an attempt to redefine what an audio parameter can do with additional features like knowing at all times what the sum of all the modulators acting on the parameter is, and stuff like that.

it works correctly in standalone, but when i debug the plugin version all my knobs jump back to 0 whenever i let go off the knob again. so i’ve put a breakpoint into the setValue() function whenever its value is 0 and traced back the source of this event to the juce_VST3_Wrapper, which apparently does this:

i can clearly see that there is a “double value = 0.” and that goes straight into my parameter with setValueAndNotifyIfChanged() here. but i’m just asking myself why that happens (only in the plugin version), like what is the reason to set a value to 0 when the knob is not dragged anymore? or… what actually triggers this to happen? and how is this usually avoided?

(and yes, i do realize it might make more sense to go back to a more high-level parameter type in order to avoid this lowlevel-vst3-wrapper stuff, but i just wanna try to do this now and decide later if it was a good idea)

The value parameter to getPoint() is an output parameter. It would have been modified with the value from the queue when getPoint returns kResultTrue. So it’s not 0 in all cases. They just initialize it to 0.0 so that it isn’t left uninitialized.

1 Like