Changing label texts between rackspace variations?

I expect this isn’t possible, but who knows? Maybe there’s a script or something that can achieve it?

I’ve set my rackspace up to mirror my MIDI controller pedalboard, so I want it to look the same between all my different tones. I can of course duplicate it between rackspaces and just change the labels to reflect what each switch does for each sound, but that comes with some added hassle if I want to change the layout in some way.

So I’m looking into rackspace variations. I’m able to use variations and route MIDI correctly from my widgets to my plugins based on variations, but I would really like to have the label texts of my widgets also change between variations. Is this somehow possible at all? Maybe scriptable?

Here a simple rackspace script

Var v_var : Integer
    ROT   : Widget

function set_widget_label (v_string : String)
 SetWidgetLabel(ROT, v_string)
end
    
On Variation(oldVariation : integer, newVariation : integer)
 Select
   newVariation == 0 do set_widget_label("Var 1")
   newVariation == 1 do set_widget_label("Var 2")
 End
End

On Activate
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do set_widget_label("Var 1")
  v_var == 1 do set_widget_label("Var 2")
 End
End
2 Likes

Awesome, that does pretty much exactly what I needed. I made a small change in order to just have one function that updates the labels, and everything seems to work great. This is an example for two widgets; I’ll update mine to include all 8 switches.

Var v_var : Integer
    btn1   : Widget
    btn2   : Widget

function set_widget_label (wdgt : Widget, v_string : String)
 SetWidgetLabel(wdgt, v_string)
end

function update_all_widgets()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn1, "Drive")
    set_widget_label(btn2, "Chorus")
    
  v_var == 1 do
    set_widget_label(btn1, "Ramp synth")
    set_widget_label(btn2, "Filter")
    
 End
end
    
On Variation(oldVariation : integer, newVariation : integer)
 update_all_widgets()
End

On Activate
 update_all_widgets()
End
1 Like

What kind of pedal board are you using? Does it support the ability to update label text via sysex messages?

I use a Hotone Ampero Control. No sysex support in this one.

That’s on the wishlist for when I upgrade the controller, along with status LEDs that I can update from GigPerformer to keep them in sync with the active rack state.

This has been my first foray into GP scripting, and I suspect I will go pretty mental with it now that I’ve made my first one. I already expanded the script to change the background colour on the rack for each variation, so lord only knows what these gig files will look like in a month :smile:

I’ve been a professional programmer for 20 years, so apparently all I needed was an excuse.

2 Likes

Pic for reference. It’s pretty cool how limited a MIDI controller can be and still be extremely useful in GP because of all the processing you can do via the widgets.

I may have spoken a bit soon. When I’m on variation 2 and press a widget, the label changes back to the saved value.

Is there a setting I’m missing on the widget, or do I need to add a handler in the script for the state change of each widget, setting the label each time?

This works, but it’s not exactly pretty code. Also, the saved label text also flashes in whenever I press a widget that has a name change for the active variation:

Var v_var : Integer
    btn1   : Widget
    btn2   : Widget
    btn3   : Widget
    btn4   : Widget
    btn5   : Widget
    btn6   : Widget
    btn7   : Widget
    btn8   : Widget
    pnl    : Widget

function set_widget_label (wdgt : Widget, v_string : String)
 SetWidgetLabel(wdgt, v_string)
end

function set_btn1()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn1, "Drive")
  v_var == 1 do
    set_widget_label(btn1, "Drive")
  v_var == 2 do
    set_widget_label(btn1, "Drive")
  v_var == 3 do
    set_widget_label(btn1, "Drive")
 End
end

function set_btn2()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn2, "Chorus")
  v_var == 1 do
    set_widget_label(btn2, "Filter")
  v_var == 2 do
    set_widget_label(btn2, "Chorus")
  v_var == 3 do
    set_widget_label(btn2, "Chorus")
 End
end

function set_btn3()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn3, "Octave")
  v_var == 1 do
    set_widget_label(btn3, "Ramp synth")
  v_var == 2 do
    set_widget_label(btn3, "Reverb")
  v_var == 3 do
    set_widget_label(btn3, "Reverb")
 End
end

function set_btn4()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn4, "Fuzz")
  v_var == 1 do
    set_widget_label(btn4, "Fuzz")
  v_var == 2 do
    set_widget_label(btn4, "Bass cut")
  v_var == 3 do
    set_widget_label(btn4, "Bass cut")
 End
end

function set_btn5()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn5, "Synth")
  v_var == 1 do
    set_widget_label(btn5, "Rock bass")
  v_var == 2 do
    set_widget_label(btn5, "Rock bass")
  v_var == 3 do
    set_widget_label(btn5, "Rock bass")
 End
end

function set_btn6()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn6, "Delay")
  v_var == 1 do
    set_widget_label(btn6, "Delay")
  v_var == 2 do
    set_widget_label(btn6, "Delay")
  v_var == 3 do
    set_widget_label(btn6, "Delay")
 End
end

function set_btn7()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn7, "Sustain")
  v_var == 1 do
    set_widget_label(btn7, "Sustain")
  v_var == 2 do
    set_widget_label(btn7, "Sustain")
  v_var == 3 do
    set_widget_label(btn7, "Sustain")
 End
end

function set_btn8()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    set_widget_label(btn8, "Tuner")
  v_var == 1 do
    set_widget_label(btn8, "Tuner")
  v_var == 2 do
    set_widget_label(btn8, "Tuner")
  v_var == 3 do
    set_widget_label(btn8, "Tuner")
 End
end

function update_all_widgets()
 v_var = GetCurrentVariation()
 Select
  v_var == 0 do 
    pnl.SetWidgetFillColor(RGBToColor(0, 0, 0.8, 0.5))
  v_var == 1 do
    pnl.SetWidgetFillColor(RGBToColor(0.8, 0, 0, 0.5))
  v_var == 2 do
    pnl.SetWidgetFillColor(RGBToColor(0, 0.8, 0, 0.5))
  v_var == 3 do
    pnl.SetWidgetFillColor(RGBToColor(0.5, 0.5, 0, 0.5))
 End
 set_btn1()
 set_btn2()
 set_btn3()
 set_btn4()
 set_btn5()
 set_btn6()
 set_btn7()
 set_btn8()
end

On Variation(oldVariation : integer, newVariation : integer)
  update_all_widgets()
End

On Activate
  update_all_widgets()
End

On WidgetValueChanged(newValue : double) From btn1
  set_btn1()
End

On WidgetValueChanged(newValue : double) From btn2
  set_btn2()
End

On WidgetValueChanged(newValue : double) From btn3
  set_btn3()
End

On WidgetValueChanged(newValue : double) From btn4
  set_btn4()
End

On WidgetValueChanged(newValue : double) From btn5
  set_btn5()
End

On WidgetValueChanged(newValue : double) From btn6
  set_btn6()
End

On WidgetValueChanged(newValue : double) From btn7
  set_btn7()
End

On WidgetValueChanged(newValue : double) From btn8
  set_btn8()
End

I refined your script a bit…

Var
    btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8   : Widget
    pnl    : Widget
    
    btn1Caps : string array = ["Drive", "Drive", "Drive", "Drive"]
    btn2Caps : string array = ["Chorus", "Filter", "Chorus", "Chorus"]
    btn3Caps : string array = ["Octave", "Ramp Synth", "Reverb", "Reverb"]
    btn4Caps : string array = ["Fuzz", "Fuzz", "Bass Cut", "Bass Cut"]
    btn5Caps : string array = ["Synth", "Rock Bass", "Rock Bass", "Rock Bass"]
    btn6Caps : string array = ["Delay", "Delay", "Delay", "Delay"]
    btn7Caps : string array = ["Sustain", "Sustain", "Sustain", "Sustain"]
    btn8Caps : string array = ["Tuner", "Tuner", "Tuner", "Tuner"]

function setAllWidgets(rsVariation : integer)
    SetWidgetLabel(btn1, btn1Caps[rsVariation])
    SetWidgetLabel(btn2, btn2Caps[rsVariation])
    SetWidgetLabel(btn3, btn3Caps[rsVariation])
    SetWidgetLabel(btn4, btn4Caps[rsVariation])
    SetWidgetLabel(btn5, btn5Caps[rsVariation])
    SetWidgetLabel(btn6, btn6Caps[rsVariation])
    SetWidgetLabel(btn7, btn7Caps[rsVariation])
    SetWidgetLabel(btn8, btn8Caps[rsVariation])
    
    Select
    rsVariation == 0 do 
        pnl.SetWidgetFillColor(RGBToColor(0, 0, 0.8, 0.5))
    rsVariation == 1 do
        pnl.SetWidgetFillColor(RGBToColor(0.8, 0, 0, 0.5))
    rsVariation == 2 do
        pnl.SetWidgetFillColor(RGBToColor(0, 0.8, 0, 0.5))
    rsVariation == 3 do
        pnl.SetWidgetFillColor(RGBToColor(0.5, 0.5, 0, 0.5))
    end
End
    
On Variation(oldVariation : integer, newVariation : integer)
  setAllWidgets(GetCurrentVariation())
End

On Activate
  setAllWidgets(GetCurrentVariation())
End

Assuming that your widgets were “buttons” as the handles implied, i used 8 LED-buttons, where i set them to “Custom Caption” and left the textbox blank, also set them all to “hide temporary values”… so i couldn’t reproduce wether the effect of “the widgets changing back to the saved state” nor any flashing text. Maybe i missed something?

Have a look at the gig file and if you encounter those issues, please tell me the exact steps how to reproduce that.
change caption on Variation.gig (126.9 KB)

You have mapped the widget to plugin parameter, right?
The Host automation mechanism sends back to plugin parameter value to the widget.
I think that is by design.

It’s mapped to a parameter, yes. I didn’t quite understand your comment though; how does the plugin parameter value affect the widget label?

Because via HOST automation the value exposed from the mapped plugin parameter sets the widget value and the widget label.
This is necessary as you set the plugin parameter via the widget and need to know the value of the modified parameter.

Ah yes… now that i mapped the buttons to a plugin parameter (i used just a mixer and mapped the buttons to the “Solo” parameters) i know why you needed those “On WidgetValueChanged” callbacks…
Simply add a “Multi-Widget” callback for that, instead of using 8 separate “single callbacks”:

// Called when any of several widgets changed
// The widget and index parameters are optional
On WidgetValueChanged(w : Widget, index: integer, newValue : double) from btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8
    setAllWidgets(GetCurrentVariation())
End

1 Like

Does that really makes sense?
You will not see this way the parameter value, right?

Maybe sometimes a changing caption and a lit button is just enough?

Ah I see. But I’ve set a custom caption and told it to hide the temporary value, so there shouldn’t be a reason for the parameter change to update the caption, only the state of the LED button. But I can see how that would be all lumped into one, even though the caption in this case stays unaffected by the parameter change.

Since the parameter is either 0 or 127 (on or off), I don’t need to see it reflected in the caption when the LED of the widget gives me the same information.

I’ll give that a shot. My fear is that it will be a bit slower and increase the flashing behaviour, since it will be processing every widget caption every time one widget is pressed. But if that happens, I’m happy to stick with the 8 callbacks. It’s not like the code is going to be updated by or be readable to anyone except me.