i have a new SoftStep 2 and i want each rackspace on activation to turn on and the LEDs as needed - in each rackspace some of my plugins begin on, and some off.
i figured out how to send the correct messages. but, what i really need is for each rackspace on activation to clear all the LEDs, test each button widget to see if it is on or not when the rackspace is activated, and send the “LED on” message to those LEDs which should be on. (Or, i could have it test all the button widgets and send an “on” message if its on, and an “off” message if it’s off).
the script here gets stuck on the “If” line, it seems there has to be something before the “If” to activate the “If”. however, i just want it to check the values that i’ve got, and send the correct LED messages. I can’t add the “If” to the “On Activate” part of the script, apparently. how can i make GP script check the values?
additionally, i would think there’s a way to simplify this all by using arrays, and/or loops, but i don’t understand how to do that.
var
SSTC : MidiOutBlock
Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9, Button10 : Widget
b1, b2, b3, b4, b5, b6, b7, b8, b9, b10 : double
l1, l2, l3, l4, l5, l6, l7, l8, l9, l0 : ControlChangeMessage
// gets initial widget values
On Activate
b1 = GetWidgetValue(Button1)
b2 = GetWidgetValue(Button2)
b3 = GetWidgetValue(Button3)
b4 = GetWidgetValue(Button4)
b5 = GetWidgetValue(Button5)
b6 = GetWidgetValue(Button6)
b7 = GetWidgetValue(Button7)
b8 = GetWidgetValue(Button8)
b9 = GetWidgetValue(Button9)
b10 = GetWidgetValue(Button10)
End
// tests whether values are 1 or 0 and sends appropriate LED state message to SST
If
b1 == 0
l1 = MakeControlChangeMessage(20,0)
else
l1 = MakeControlChangeMessage(20, 1)
End
SendNowExternal(SSTC, l1)