Blog article on bypassing plugin automatically when volume is off

I wrote this tutorial the other day that might be of interest to some users here. It’s a nice way to save cycles (if necessary) by bypassing plugins automatically when the volume is zero

https://www.gigperformer.com/bypass-plugins-automatically-when-volume-is-off/

2 Likes

That’s fantastic! I haven’t attempted scripting yet, but this tutorial looks so simple that I believe I can start learning how it’s done. Thanks for all you do for the Gig Performer community.

This is great. Can we have this as a text file to copy and paste, modify, etc? Thanks!

I don’t have that script handy (in fact, I’m not even sure I kept it) but the entire script is only a few lines to type out (and typing it will probably help to get you comfortable with using GP Script)

True. I’m thinking it would be nice to have a collection of these in a folder somewhere for us lazy dudes!

OCR is your friend :wink:

And the reason I post this, the above screen is incomplete… easy to left things out.
But its complete on the blog post :wink:

   //$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   AaltoPlugin : PluginBlock
   SynthVol : PluginBlock
//$</AutoDeclare>

// Called when a plugin block parameter value has changed
On ParameterValueChanged(parameterNumber : integer, parameterValue : double) from SynthVol
    if parameterNumber == 0
        then SetPluginBypassed(SomePlugin, parameterValue < 0.1)
        end  
End

Yay. Thank you!

I’m trying to adapt something similar to this, but I don’t want it happening when the volume is zero, I want it when the input level of certain channels falls beneath a certain threshold. I’ve been digging through the scripting manual and functions, but have not found anything that deals with input/output levels of channels.
Am I missing something?

1 Like

You can assign a widget to the input level and read that from GPScript via GetWidgetValue

2 Likes

Some sample code if using a widget value to bypass a plugin.

// Bypass a plugin when a widget reaches a specified threshold.
Var
   my_plugin : PluginBlock
   my_widget : Widget
   my_bypass_threshold : Int

// Called once when rackspace is first loaded. Set threshold here.
Initialization
    my_bypass_threshold = 10  // Update as required (0..127)
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from my_widget
    If newValue <= MidiToParam(my_bypass_threshold) Then
        SetPluginBypassed( my_plugin, true)
    Else
        SetPluginBypassed( my_plugin, false)
    End
End
3 Likes

How to add note off message there? So when I turn down the volume thus bypassing the plugin while holding a note or chord, I won’t have hanging notes when I un-bypass the plugin.

Thanks - a very useful script. :+1:

I have done this before with a much more complicated script with “on widget change …” and “…if then else…” statements. But this one is very elegant and more compact.

This brings me to another point as a GP rookie:

There are many good hints and tips in the forum in blogs / videos… useful for a beginner. Unfortunately they are often hidden in long threads and not always easy to find.

What i’m missing a bit is one place with a comprehensive but easy to use “how to” dictionary or "best practice or “red book” with all the useful tips and hints - reviewed, cleaned up / optimised and approved by one of the GP Masters User.

Like in my example:
I know i need to bypass plugins to reduce CPU load when not used (Volume = Zero). After some try and error test I found a (bad or not perfect) solution. A place where i can search for a standard solution for a common problem would have saved me time, improved my scripts and may reduce the fear to use scripting for some newcomer.

Besides this category Tips and Tricks - Gig Performer Community
GP4 will bring many improvements…

Do you face such a hanging note?

Absolut - there is the category “Tips and Tricks” and the tips and hints have been very useful for me.

My remark was not a complain – only a wish to have a more compact and on the point collection. Like the example " BYPASS PLUGINS AUTOMATICALLY WHEN VOLUME IS OFF". The problem-statement … the Solution … explanation how the solutions works.

I absolutely see your point, but i guess this wouldn’t be so easy to establish and even harder to maintain… as you had noticed by yourself, there are always diffrent approches to solve a problem.
A “standard” solution is very often simply not existent as such.
And most clever solutions tend to “grow” from (sometimes very long) discussions and threads.

So, to get a pool for all this standard (or individual) solutions for issues and problems, someone had to permanently crawl through the forums and had to filter out the needed information and extract everything clean and tidy to a separate place…
And all this information had be be held up to date! This would be a fulltime job and, honestly, i would not want to do it. There are only two developers who also are the admins of these forums - the rest of us is just ‘normal’ users (well some of us might be kind of crazy :crazy_face:) who voluntarily do the job of moderators.

Of course it’s very commenadable if you first search yourself for answers and solutions that are already here, this is what everyone should do.
But if you don’t find the right answers to your qustions, it’s always best to ask the community.
Just dare to ask… there are so many helping hands here. :beers: :+1:

2 Likes

Yes, Lets say, I hold a chord with strings pad vst then I turn the volume down so the vst is bypassed. Then, few moment later I turn it up again, activating the vst, that last chord I hold is still going. I need to hit panic button to turn the notes off.

with what plugin specifically ??

OK, I tried with Blue3 VST and with this plugin unbypassing does not get a hanging note.
What VST do you use?

It can be anything. It happend with all kind of long sounding patches like pad, strings, flute, organ. I use Orchestral companion Strings, Orchestral companion woodwind, brassinematic, etc.

Basically, what happend (I think) is this:

  1. I hold the notes, sending note on message to vst.
  2. I bypass the vst whil holding the note, so the vst never get note off message.
  3. I activate the vst again still holding the last message which is note on.