Proper implementation of the getBypassParameter()

Hi all,
I am trying to connect my bypass parameter to the host’s bypass button. I found out there is a method that is being used for this. I overridden the method in my PluginProcessor as shown below :

In PluginProcessor.h

AudioProcessorParameter* getBypassParameter() const override;

in PluginProcessor.cpp

AudioProcessorParameter* PluginProcessor::getBypassParameter() const
{
    if(AudioProcessor::getBypassParameter()==nullptr)
    {
        return paramterTree.getParameter(pBypassBtn);
        //This is being called all the time.
    }
    else
    {
        //This is never being called! So whenever this method is called. It is always nullptr
        return nullptr;
    }
}

Now it communicates with DAW and it changes the bypass button that I have on my GUI. But I have another issue now. In Cubase, there is a "Bypass Inserts " button.

This button, as its name implies, activates/bypasses all inserts(plugins) at once. But the minute I implement the getBypassParameter as above, it stops activating/bypassing.

Also, I tried to debug the getBypassParameter. When it is being called it is always nullptr. There is no single call with a nonnullptr value.

Does anyone know why?

Thanks in advance :pray:

I think there is some misconception about how this is supposed to work. This function is supposed to be called by the host and for you (a plugin manufacturer) to override – as you did.
You have two possible implementations for this “bypassing” mechanic. Either return nullptr and also override processBlockBypassed. The host will call processBlockBypassed while it bypasses your plugin.
If you return a pointer to a parameter, you are supposed to check in processBlock weither the host is telling you to bypass (using the parameter you provided).

So far the theory. Making the super call is therefore making no sense.

In praxis with the very loose mindset of hosts going by the rule book of what VST and AUs say it is supposed to work, here are a few points, that I would keep an eye out for:

  • Even when using the bypass parameter way, the hosts are most likely still not trusting in your plugin to emit silence or anything but zero the block themselves after calling processBlock
  • I’ve heard from multiple occasions, that the bypassing may be implemented by just not calling your plugin at all. Neither processBlockBypassed or processBlock.
  • The hosts may have more than one definition and implementation of “bypassed”. The conventional with one toggle button next to your plugin, but also silencing the entire channel strip or signal chain or what ever.

What this means for you is:

… not quiet clear to me, because I understand this sentence. What exactly is happening vs what is supposed to happen (from Cubase perspective) vs what is supposed to happen if it was up to you?

Thank you for your reply. After overriding the getBypassedParamter method, whenever the host changes the bypass state from the bypass button within the host, it triggers my bypass parameter listener and it flips its state. So even without checking the state of the bypass that the host changed, it all works fine. The "bypass inserts " button is another button that bypasses all inserts. Without overriding the getBypassedParamter, it works and bypasses all plugins including mine. But after overriding the getBypassedParamter, my plugin stays on all the time. The “bypass inserts” button is not working for my plugin anymore. I want to keep getBypassedParamter overridden and the “bypass inserts” button keeps working as it works before overriding the getBypassedParamter.

When you say “doesn’t work”, does that mean your plugin is able to emit sound or that the bypass parameter is not toggled but your plugin is muted by Cubase anyhow?

All I can see is that Cubase calls getBypassedParamter and flips the value of the bypass parameter when its ordinary bypass is toggled but it does not call getBypassedParamter when the “bypass inserts” button is toggled. This happens when I override the getBypassedParamter. I checked the VST3 wrapper to see if there is something else in the getBypassedParamter that I need to add or check other than returning the bypass parameter but there is nothing. I saw i few plugins using Juce and work properly in both cases. I think they are using a customized version of Juce but I am not sure.

I mean it has no effect. Let’s say my plugin is on. I click on the “bypass inserts”. My plugin stays on, the icon of the Cubase stays on and my plugin still processes the sound. I dial the knobs and the sound changes. The other plugins that are on the same insert group, receive the changes of the “bypass inserts” button and they bypass or unbypass themselves.

That sounds to me like a bug in Cubase to me. If Cubase does not flip the parameter, there is no way I can think of for you to fix it :confused:

Exactly, but as I said some plugins can know if that button is pressed. I think it needs more than overriding the getBypassParameter method.