AudioParameterInt etc

Hi, I think I must be missing something about how these are intended to be used.

I’ve subclassed the class so I can override setValue() to be my own processing, but as they’re private methods I can’t call the base functionality. Am I missing something? Is there some other mechanism I should be using to monitor parameter changes from the host?

thx

Hi. anybody had experience of doing a similar thing and has comments? thx

So, I’ve added the missing listener for the “new” method and overriden:

audioProcessorParameterChanged( AudioProcessor *processor, int index, float newValue );

However, this isn’t getting called back when I change a parameter in a DAW or in the plugin host app.

If I make my own update by calling setValueNotifyingHost() then it gets called so it looks like everything is wired up properly…

Unfortunately the AudioProcessorListener is misleading. Eventually it was meant for that purpose, but here is explained where the audioProcessorListener is actually used:


That explains, why you are not notified, when the change is a result from the host.

If you want to have callbacks from the AudioProcessorParameters, I found AudioProcessorValueTreeState with AudioProcessorValueTreeState::Listener::parameterChanged() very handy.
There is also a AudioProcessorValueTreeState tutorial, and some months ago I played around with it on github - tapeDelay

hi. thz for the info. I was looking at the AudioProcessorValueTreeState and started down that path but it didn’t seem to support the Int/Float/Choice types of the AudioProcessorParameter. Thx for the link to the tutorial, I’ll check it out tomorrow…

Even better, it encapsulates the data and you can use AudioProcessorValueTreeState::ComboBoxAttachment as choice and the ButtonAttachment for bool parameters.

1 Like