@edm11, I decided to give your script a go (in place of my widget solution). However, I a getting an error by the compiler.
@pianopaul @edm11 interestingly, the scripts I have in this rack was written/came from each of you. I am now getting a “Semantic error: Line 65, Col 1: Initialization block already defined” I don’t yet know enough about scripting to figure this out . Here are the scripts. Any help would be appreciated!
var A : Widget
EA : ExternalWidget
B : Widget
EB : ExternalWidget
C : Widget
EC : ExternalWidget
va : double
vb : double
vc : double
initialization
va = A.GetWidgetValue()
vb = B.GetWidgetValue()
vc = C.GetWidgetValue()
end
on Activate
if BindExternalWidget(EA, “A”, “Control”) then
A.SetWidgetValue(GetExternalWidgetValue(EA))
end
if BindExternalWidget(EB, “B”, “Control”) then
Print(“On Activate B”)
B.SetWidgetValue(GetExternalWidgetValue(EB))
end
if BindExternalWidget(EC, “C”, “Control”) then
Print(“On Activate C”)
C.SetWidgetValue(GetExternalWidgetValue(EC))
end
End
// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from A
if newValue <> va then
SetExternalWidgetValue(EA, newValue)
va = newValue
end
End
On WidgetValueChanged(newValue : double) from B
if newValue <> vb then
SetExternalWidgetValue(EB, newValue)
vb = newValue
end
End
On WidgetValueChanged(newValue : double) from C
if newValue <> vc then
SetExternalWidgetValue(EC, newValue)
vc = newValue
end
End
//******************Bias Scene Selection
Var
SceneBlock : MidiInBlock
a : ControlChangeMessage
b : ControlChangeMessage
c : ControlChangeMessage
d : ControlChangeMessage
// Set CC messages
initialization
a = MakeControlChangeMessage(11, 127)
b = MakeControlChangeMessage(12, 127)
c = MakeControlChangeMessage(13, 127)
d = MakeControlChangeMessage(14, 127)
end
// Called when you switch variations
On Variation(oldVariation : integer, newVariation : integer)
If newVariation == 0 then
SendNow(SceneBlock,a)
elsif newVariation == 1 then
SendNow(SceneBlock,b)
elsif newVariation == 2 then
SendNow(SceneBlock,c)
elsif newVariation == 3 then
SendNow(SceneBlock,d)
End
End