How to use radio buttons to recall GP Presets of a plugin and then control those buttons via variations

Thanks for pointing to this issue and “bravo” for finding a quick solution! :+1:
I forgot to test in the script for “ON” values only - classical beginner’s fault! (sigh) - so the script attempted to load a preset for both widget conditions “ON” and “OFF” which can lead to issues…
I tested the rackspace on my machine and everything worked well, so i didn’t notice my fault.
I corrected the script, so that there should be no issues anymore, no matter if “Send on Radio Off” is activated or not.
Could you please test the corrected version of that rackspace, if it works “out of the box” now?

12 button preset select V2.gig (459.0 KB)

I’ll take a look… it requires of course that I populate all the buttons with presets I want recalled so I’ll have to test a bit later today.

Of note, the v1 script worked just fine if I used the mouse to change the butttons state but once I was using variation changes which recalled those button states, that’s where the inconsistancy started and it behaved fine for some and others it wouldn’t switch to until I went to it twice.

yes, I switched my buttons back to their default state and patched the script with the change and it works correctly.

Thanks for your feedback! :+1:

@schamass This script was super helpful! Thanks so much for writing and sharing it.
I am now able to use my keyboards and guitars in the same .gig file, which has really
streamlined my workflow in the studio. It will also help on shows to be able to play keys
and guitar and switch off from song to song. AMAZING

@schamass now in Portuguese! :slight_smile:

Other:

Great script!

How could it be adapted so that you can apply this idea to different vst blocks on the same rackspace?

Thanks!

In the above example the plugin Pianoteq has the handle assigned of plugin01 so it becomes the PluginBlock that is addressed in this script.

You can probably add more variables for more plugins (plugin02, plugin03) to this but I am guessing they would need their own buttons (pad01a, pad01b, etc…) assigned to them specifically in the script. Maybe @schamass knows the syntax to do this expansion.

Thank you very much!
aparently copying the code and assigning new names so that there are no repeated variables works fine! Awesome!

I only tested on local rackspace. I guess It would work exactly the same for global rackspaces and can work at the same time, right?

I am new to Gpscripts, this is a new world of possibilities!

Yes it will work in global rackspace scripts as well, specific to buttons and plugins present in the global rackspace.

It might even work across the entire system as a gig script but that might get overly complicated to manage.

Its an easy script to duplicate and iterate per-rackspace scenario and since it works on the name of the saved GP preset it’s flexible in that you don’t need to go into the code each time, you just need to update the button with the preset name which is very intuitive.

Hello,
I can’t get your settings to work in global rackspace.
Can you explain how to do this?
Thanks a lot

What have you done so far? Did you place the needed widgets in the global rackspace? Did you copy the script to the global rackspace script?
What is not working?

Thanks @schamass for this incredibly useful GPscript!
I’d like to take it a step further and create radio buttons recalling presets for 3 different plug-ins in the same Rackspace (EchoBoy, Eventide H910 and Valhalla Reverb).
The first PI (EchoBoy) works perfectly, but when I copied and pasted the same script, changing the plug & widget names appropriately, compiling gets caught up on “lblPresetName”:
(Script Entity: Rackspace) - Semantic error in “Main”: Line 37, Col 1: Identifier ‘lblPresetName’ already defined

Any assistance would be very much appreciated!
I don’t know coding or scripting so in over my head on this one…

That’s the kind of error you get when a variable is being defined more than once, like in this example:

You’ll want to look through the script for that lblPresetName : widget variable being defined in the Var section more than once. Remove the extra and compile again.

Thanks @edm11, this means I need to use something other than “widget” for a PresetName?
I really have no idea how to proceed or if what I need is even possible this way…

This is what I have so far:

Its line 37. That lblPresetName : widget variable was already defined earlier in line 3. Simply erase what’s in line 37 and recompile the script.

323

322

Yep, that’s what the compiler says as well…

Fixed!
I just learned the awesome power of “Auto declare blocks and widgets”.

Really appreciate your time and attention @edm11!

Great script, just what i needed to control plugins with limited midi implementation. Here is a variation on the script that uses buttons 1 to 6 for user presets in one plugin and 7 to 12 for presets in another plugin. Now i can change guitars/pickups in Bias fx 2 and amps in Tonex with the push of a button.

var
pad01, pad02, pad03, pad04, pad05, pad06, pad07, pad08, pad09, pad10, pad11, pad12 : widget
lblPresetName : widget
plugin01, plugin02 : PluginBlock

padField : widget array = [pad01, pad02, pad03, pad04, pad05, pad06, pad07, pad08, pad09, pad10, pad11, pad12]

Initialization
var
index, activePad : integer
activePad=0
    for index = 0; index < Size(padField); index = index +1 Do
        if GetWidgetValue(padField[index]) >0.6 then
            activePad=index
        end
    end
    SetWidgetValue(padField[activePad],1.0)
End

// Called when any of several widgets changed
// The widget and index parameters are optional
On WidgetValueChanged(w : Widget, index: integer, pVal : double) from pad01, pad02, pad03, pad04, pad05, pad06, pad07, pad08, pad09, pad10, pad11, pad12
var
actPresetName : string = ""
    if pVal > 0.6 then
        actPresetName= GetWidgetLabel (w)
        SetWidgetLabel (lblPresetName, actPresetName)
        if not (ToUppercase(actPresetName) == "EMPTY" or actPresetName == "") Then
//Route pad01 to pad06 to plugin01, pad07 to pad12 to plugin02
            if w == pad01 or w == pad02 or w == pad03 or w == pad04 or w == pad05 or w == pad06 then
            LoadGPPreset( plugin01, actPresetName)
            Else
            LoadGPPreset( plugin02, actPresetName)
            end
        end
    end
End