How to replace AudioProcessorParameter with AudioProcessorParameterWithID?

How to replace AudioProcessorParameter with AudioProcessorParameterWithID in existing audio-plugins and ensure parameter ordering?

If its enough to use as Parameter ID the (old) Index “0”, “1” as String(parameterIndex) … to mimic the old behaviour?
Will this work for audio-plugin formats AU, VST3 and AAX, and ensure the right parameter order when loading the plugins, for now and forever?

If have a lot of specialised AudioProcessorParameter classes.

I think that you’ll have to use the JUCE_FORCE_USE_LEGACY_PARAM_IDS
macro/option in projucer :

Ah Thanks, i might have misinterpreted this section

Sorry i have to come up with this again, i think JUCE_FORCE_USE_LEGACY_PARAM_IDS is referencing to the very old parameter system via the now deprecated get/setter functions inside AudioProcessor.

I already used AudioProcessorParameter (without WithID) without JUCE_FORCE_USE_LEGACY_PARAM_IDS, so used AudioProcessorParameter with managed Parameter system.

If i now want to replace AudioProcessorParameter with AudioProcessorParameterWithID, to retrieve the same value i just mimic the AudioProcessorParameterWithID with the ID as String(indexposition) to retrieve the right values, am i right?

@fabian ?

Yes, you’re right. Use String (index); as your parameter ID.

AudioProcessor::getParameterID has had some unusual behaviour for a few years, which has only recently come to light - if you overrode this method to return anything other than String (index); then your code would assert and very obviously fail to work. This was fixed a couple of days ago on the develop branch, but it’s very surprising no one else has discovered it.

1 Like