This project has moved and is read-only. For the latest updates, please go here.

VST Bypass

Topics: Host Compatibility, Host Development, Host Processing, Plugin Parameters
Apr 1, 2014 at 2:41 PM
started a new discussion

My Question

I've been playing with this code and it actually works, and works well!

Have a question i was trying to do an effects bypass such as plugins[0].SetBypass(true); and it is not an working.

I'm i doing this right?

Marc's answer from other location

If a plugin support its own bypass it will respond to a 'bypass' CanDo (VstPluginCanDo.Bypass). If it does not respond to that can-do string, it does not support bypass and the host should implement it.

The VST.NET Framework implements the CanDo method by checking the interfaces for the various features (IVstPluginBypass in this case).

Hope it helps.
Apr 1, 2014 at 2:48 PM
So you wrote if the vst doesn't support bypass then the Host should implement it,
How would i do that? remove the VST from the VstPluginContext?

BTW, Amazing work you have one with this.
Apr 1, 2014 at 3:51 PM
Hi Jeff,

I cannot judge the specifics on how to do it, because it relies on how you have setup things.

If the plugin does not support it, a bypass would simply not call the plugin for audio and midi processing but bypass the input (that would normally go to the plugin) directly to the output - that either goes to the next plugin or the mixing stage or audio output device of your host...

The VstPluginContext represents the plugin to the host. When you release that you loose your plugin and have to load it again (expensive). So the VstPluginContext should be kept alive as long as the plugin is used (bypassed or not).

Apr 1, 2014 at 4:51 PM
I think I have a way that may work.
not very conventional but just did a test and seems to not have not noticeable issues.

Basically when playing the audio(in my case a loop file). I start a clean version of it as the same exact time., but doing this i can just control the volume to the vst output.

Kind of the way you would do it in the studio with an external rack effect.

Apr 1, 2014 at 6:00 PM
That sounds like an expensive way to do it.

This is the implementation the Audio processor base class uses to implement bypass. Call this instead of the plugin and you'll have bypass...
public virtual void Process(VstAudioBuffer[] inChannels, VstAudioBuffer[] outChannels)
            int outCount = outChannels.Length;

            for (int n = 0; n < outCount; n++)
                for (int i = 0; i < inChannels.Length && n < outCount; i++, n++)
Hope it helps,
Apr 1, 2014 at 6:06 PM
I would just call ProcessReplacing as usual with the correct Input Channels and Ignore the Output Channels.
If the effect is something like a look ahead compressor, it might use the Input Channels even in case of a bypass.