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

Alright… this should work:

EDIT:
There was a scripting fault - please download the new and corrected version (V2) of the gig file!

This is a 3x4 button matrix to switch between previously saved GP-Userpresets of a plugin (here Pianoteq from Modartt).
Enter panel EDIT mode and use the same widget caption like the name of GP-Userpreset you want to recall. If the “Customized Caption” of the widget is not “empty” or “” then pressing that button will attempt to load the the GP-Userpreset corresponding to the widget’s caption.
Of course you should have saved some GP-Userpresets to be recalled…

12 button preset select3

The buttons act as radio buttons, so there can only be one active at a time.
The font color of the widgets is set to full transparaent, so that there is no visual distraction by long or cryptic captions.

The 12 widgets can of course be MIDI learned to buttons of your hardware controller.
And you can save a setting as variation, so you can call it via PC from otside of GP.

Everything is done via GP-Script, so if you change the number of buttons or the used plugin, make sure you make the needed changes in the script and in the widget/pluginblock handles!
(And don’t forget to re-compile after you have changed something.
AND MAKE A BACKUP BEFORE STARTING TO EXPERIMENT! :wink: )

12 button preset select V2.gig (459.0 KB)

This is the script behind the curtain:

var
pad01, pad02, pad03, pad04, pad05, pad06, pad07, pad08, pad09, pad10, pad11, pad12 : widget
lblPresetName : widget
plugin01 : 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
            LoadGPPreset( plugin01, actPresetName)
        end
    end
End

11 Likes