Create AudioProcessorParameters after BusesLayout was chosen?

Suppose I want to create a multi-channel gain plugin. The same plugin should support Mono, Stereo, 5.1, etc. The glorious function of this marvelous plugin is to provide one gain slider for each audio-channel and it also exposes one plugin parameter for each of those sliders. The parameters are named “Left Gain”, “Right Gain”, etc. according to getChannelTypeName().

Is it possible to implement this? I guess I’m asking if it’s safe/valid to call addParameter() after a channel layout has been chosen and if there’s a function like audioIOChanged() I can hook into.

thanks & best,
Ben

@fabian is this currently possible ?

Unfortunately this is not possible. The reason is, that JUCE chose not to allow parameters to be added or removed once created, because that was long time not supported by the hosts, and still only a few hosts allow that.

But the buses layout can change during lifetime, so this has to be seen independently (e.g. by changing a mono bus to a stereo bus, or connecting a side chain).

It seems that some people had success to hack the parameters, so they can be renamed and if the name is empty, they seem to be hidden, but that behaviour needs to be verified for the different wrappers and hosts, before it can go into the API. But with that a workaround would become possible.

While this is unfortunate, it makes perfect sense. Thanks!