Bypass in AU and backwards compatibility

Our old code used the VST3 SDK’s “auwrapper” to wrap our VST3 plugins as Audio Unit plugins. I’ve been working on an issue where we noticed that the index was wrong (off by one) in our loaded old (pre-JUCE) sessions that had automation data. Looking into the old auwrapper code, I found that the wrapper ignores the Bypass parameter, because the hosts supply their own. So, for our AU versions, I stopped adding that parameter. Unfortunately, that means that we no longer get notifications for changes to the host’s Bypass parameter.

So, my question is, how can I maintain backwards compatibility with our old pre-JUCE auwrapper plugins, but still get notifications when the host-provided Bypass parameter is changed? We need this because our code needs to handle Bypass differently than simply feeding the inputs to the outputs when rendering; we need to set a flag in our DSP so that we can prevent artifacts when Bypass turns on or off while playing audio.

So far, the only option I’ve found that works for both new automation and loading old automation is to add my Bypass parameter to the end of my list of parameters, so that it does not affect the indexing of any other parameters. That leaves us with two Bypass parameters, but at least they both work, and old and new automation are correct.

But if there is a way to get notifications when the host-provided Bypass parameter changes, without adding our own parameter, that would be the best option. Is that possible?

As I’m dealing with bypass issues myself, I read through the thread some people were discussing how to implement getBypassParameter() which lead to the current implementation.

In the discussion it is stated it is possible to use a parameter for getBypassParameter that is not part of the plugin parameters, just to get the notifications you want to get. Maybe that’s another option you could use for AU only to avoid having two parameters visible.

Any idea how to do that? I can’t use createAndAddParameter(0 to do that, since it adds the parameter. And I can’t create a Parameter object, since that is a private class within the AudioProcessorValueTreeState class. And I can’t create an AudioProcessorParameter (the class type returned from getBypassParameter()), because it is an abstract class. So, how do I create a parameter and not add it to my parameters list?

I haven’t tried it this way, but you could create a subclass of AudioProcessorParameter, create an instance in your plugin and return a pointer to that.

Or you could use AudioParameterBool which is a subclass of AudioProcessorParameter.

I’m not sure how well this mixes with AudioProcessorValueTreeState. Maybe someone else can chime in who has implemented this.

Yeah, that worked. That gives me a parameter I can return from getBypassParameter(). Unfortunately, it doesn’t help in Logic, which seems to ignore that function altogether. But it does help in Studio One, where I can now see just one Bypass parameter, and it is properly tied to the parameter that I created, allowing me to implement the smooth transition to bypassed state that we need. Thanks!