Parameter::Listener vs APVTS::Listener

Dear JUCE knowledge fountain,

What are the differences between being a parameter listener and an APVTS listener?

So far, I can see:

  • Parameter Listener callback must be real-time safe
  • Parameter Listener can be informed of gestures as well as value changes
  • Parameter Listener gets an index instead of a name

I am led to many questions…

Does AudioProcessorValueTreeState::Listener::parameterChanged have to be real-time safe?

During AudioProcessorValueTreeState::Listener::parameterChanged, you are not guaranteed to get an up to date value for the parameter, except through the float newValue function parameter - is this the same for AudioProcessorParameter::Listener::parameterValueChanged?

Can I expect up to date values for the other parameters during these callbacks?

Thank you for any insights.

if the parameter listener was realtime-safe it would be triggered exclusively in between processBlock calls, because parameter changes affect the dsp that runs in pB. but that would also mean that you could ignore the listeners altogether and just get all the parameter values at the start of pB and compare them with some cached values, which is why a lot of people are doing it like that. a few times I also read about people who had trouble with listeners (but i don’t remember if those were parameter or apvts ones), where it suddenly didn’t work anymore when using a DAW’s bounce feature, indicating that the update speed of those listeners isn’t linked to block sizes, but like a timer or so. I really don’t know what those listeners are meant to be used for

Good reminder about the offline processing, thanks.

One could certainly use the parameter listeners for UI things, like lighting up an EQ point when it’s in a gesture.