Having trouble with most simplest script: I would like to make a button in rackspace, that will change the tempo to say, 150 bpm. I dragged a button to rackspace and GPScript Named it to TempoSet. The script is
Var
TempoSet : widget
//Set tempo to 150
On WidgetValueChanged(newValue : double) from TempoSet
SetBPM(150)
end
What happens is that everytime I go to that rackspace it sets the tempo to 150. Without pushing the button. What am I missing? How should I do this?
You should check the newValue
If it is equal to 1.0 then set the bpm and set the widget value back to 0.0
The callback is automatically executed when the rackspace/variation is switched.
Thanks, didnât realize the callback behaviour. This seems to work when widgetâs âinitial value on loadâ is set to 0 and âAlso on rackspace activationâ is checked, if other newbies are wondering.
Var
TempoSet : widget
//Set tempo to 150
On WidgetValueChanged(newValue : double) from TempoSet
If newValue == 1
Then
SetBPM(150)
newValue = 0
Else
newValue = 0
end
end