Hello All…
I am really new to this scripting, and must admit this is hard for me.
I have a series of button widgets that I use to change a plugin’s preset via a CC command. That bit is done. The big issue I came across, it that when I select a widget button, it turns on visually, but the previously selected widget stays on. So it can get confusing as to the preset you are actually using.
I have managed to solve this in scripting. And it works perfectly. My question, is now I would like to add more presets, and wonder if there is a more efficient way to script this. I just have no idea.
Thanks in advance…!!!
// MIDI Section
Var
MIDI_IN : MidiInBlock
// Widget Section
Var
Preset_1 : Widget
Preset_2 : Widget
Preset_3 : Widget
Preset_4 : Widget
Preset_5 : Widget
Preset_6 : Widget
Preset_7 : Widget
Preset_8 : Widget
Preset_9 : Widget
Preset_10 : Widget
Preset_11 : Widget
Preset_12 : Widget
Preset_13 : Widget
Preset_14 : Widget
Preset_15 : Widget
// Pedalboard Preset Section
On WidgetValueChanged(newValue : double) from Preset_1
If (newValue > 0.5)
Then
SendNow(MIDI_IN, MakeControlChangeMessage(11,127))
// SetWidgetValue(Preset_1, 0)
SetWidgetValue(Preset_2, 0)
SetWidgetValue(Preset_3, 0)
SetWidgetValue(Preset_4, 0)
SetWidgetValue(Preset_5, 0)
SetWidgetValue(Preset_6, 0)
SetWidgetValue(Preset_7, 0)
SetWidgetValue(Preset_8, 0)
SetWidgetValue(Preset_9, 0)
SetWidgetValue(Preset_10, 0)
SetWidgetValue(Preset_11, 0)
SetWidgetValue(Preset_12, 0)
SetWidgetValue(Preset_13, 0)
SetWidgetValue(Preset_14, 0)
SetWidgetValue(Preset_15, 0)
// Else
// ClosePlugin(Clean)
End
End