Missing sanity check in audio processor's parameter related methods


#1

Hi,
I recently stopped inheriting from the parameter methods to use juce::AudioProcessorParameter instead in my audioProcessor (at last :grin:).
It seems the AudioProcessor::getParameterText method (as well as other methods) assumes the host always calls the audioProcessor with a valid index. As the host is often a third party software, we have no control over its behavior.
So I would be nice to have some sanity check to prevent that kind of issue:


Here is the call stack:
10
Which ends up by a SIGSEGV.
To trigger this I restored a session with ableton live 10 after removing some of my audio processor’s parameters. Live seems to assume that the number of parameter of a plugin does not change from a session to another.
Thanks.


#2

Live seems to assume that the number of parameter of a plugin does not change from a session to another.

I think every DAW makes that assumption, changing parameter indices will break automation across the the board. A sanity check makes sense for debugging, but parameter indices should really never change. EDIT: The number of parameters needs to be fixed at compile time as well (or rather, you can’t dynamically change the number of parameters willy-nilly, most APIs don’t support removing parameters)


#3

Yes, JUCE doesn’t support changing the number of parameters dynamically because even when the plug-in format allows it host support is pretty patchy.

I’ll make those functions safer anyway.


#4