I have rackspace with a widget sending different CC values in different variations from a virtual Midi In block. When switching variations, works as expected. However, when switching from another rackspace back to the rackspace, It doesn’t send out the CC’s. I suspect b/c there wasn’t a widget “change” as far as GP is concerned? This is a problem b/c I’m not getting the sound I want without those CC’s. Honestly, I do not want to go to scripting on this to send those CC’s every time those variation are chosen, b/c I change/edit/setup variations a lot and its so easy to turn a dial and I can see the visual representation of what I just did and don’t want to have to edit the script each time. Unless there was a script that generally instructed GP to send widget values each time that variation is accessed without having to specify and edit the value each time?
Can you upload a small gig file showing the issue?
Sure. Please open the midi monitor in 2nd rackspace. Notice CC’s are sent when switching variations in 2nd rackspace.
However, no CC’s are sent when switching from 1st RS back to 2nd. I would like the widget to send the CC’s even when switching from another RS.
Sample NoWidgetCC switching racks…gig (57.3 KB)
Try this gig
WidgetCC.gig (46.1 KB)
The trick is this generic rackspace script:
//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
KNOB : Widget
v_value : double
v_tick : double
//$</AutoDeclare>
// Called when a single widget value has changed
On Activate
v_value = KNOB.GetWidgetValue()
if v_value == 1.0 then
v_tick := -0.01
else
v_tick = 0.01
end
KNOB.SetWidgetValue(v_value+v_tick)
KNOB.SetWidgetValue(v_value-v_tick)
End
Very nice!!! This is great b/c it works for any value without needing to update the script! Thank you so much!
I found a bug:
Please use this script:
//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
KNOB : Widget
v_value : double
v_tick : double
//$</AutoDeclare>
// Called when a single widget value has changed
On Activate
v_value = KNOB.GetWidgetValue()
if v_value == 1.0 then
v_tick := -0.01
else
v_tick = 0.01
end
KNOB.SetWidgetValue(KNOB.GetWidgetValue()+v_tick)
KNOB.SetWidgetValue(KNOB.GetWidgetValue()-v_tick)
End
Thank you Paul! I appreciate your quick response and that you kept checking and updated the script! I didn’t discover this behavior until just now and I feel much better about my gig tomorrow night!
I can’t help but wonder, shouldn’t this be the default behavior of GP???
I am not sure, this would force the callback on WidgetValueChanged() to be executed.
Now it is only call when there is a WidgetValue Changed.
The change you want could break some scripts as then the callback is triggered but the widget value has not been changed.
Another use without scripting.
Use SetList Mode
Here you can save the widget values in the song parts !
Now when you switch back to a song the widget is restored from then song part and the CC Message should be sent.
Just tested, works when the value saved in the song part differs from the widget value in the rackspace.
Hm…The setlist mode is not working for me. I changed the widget value from what’s in the RS and saved the song part. When I switch to another song part with a different RS and back, it is not sending the CC’s. That actually would be a pretty cool trick. Wonder why its not working for me?
Are the song part values different from what is set in the variation?
Yes they are.
You are right, I was not exactly checking in my test => use the script.
Its very strange. It randomly DOES work in setlist mode. But not always. I can’t figure out when and why. Most of the time it doesn’t send the CC’s but sometimes it does. Odd!
Yes, your script works great! Just for my learning… I have two widgets that I incorporated in your script. Is this the best way to include both widgets or is there a better way to combine them?
//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
//Send Widget value on RS change
KNOB1, KNOB2 : Widget
v_value : double
v_tick : double
//Send Widget value when switching RS- Called when a single widget value has changed
On Activate
v_value = KNOB1.GetWidgetValue()
if v_value == 1.0 then
v_tick := -0.01
else
v_tick = 0.01
end
KNOB1.SetWidgetValue(KNOB1.GetWidgetValue()+v_tick)
KNOB1.SetWidgetValue(KNOB1.GetWidgetValue()-v_tick)
v_value = KNOB2.GetWidgetValue()
if v_value == 1.0 then
v_tick := -0.01
else
v_tick = 0.01
end
KNOB2.SetWidgetValue(KNOB2.GetWidgetValue()+v_tick)
KNOB2.SetWidgetValue(KNOB2.GetWidgetValue()-v_tick)
End
With widget arrays the code would be shorter
Try this
//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
K1 : Widget
K2 : Widget
WA : Widget Array = [K1, K2]
i: integer
v_value : double
v_tick : double
//$</AutoDeclare>
on Activate
For i=0; i < Size(WA); i=i+1 Do
v_value = GetWidgetValue(WA[i])
if v_value == 1.0 then
v_tick = -0.01
else
v_tick = 0.01
end
SetWidgetValue(WA[i],GetWidgetValue(WA[i])+v_tick)
SetWidgetValue(WA[i],GetWidgetValue(WA[i])-v_tick)
End
end
This should be a function.
Function ForceWidgetUpdate(w : Widget)
var
v_value : double = w.GetWidgetValue()
v_tick : double = if v_value == 1.0 then -0.01 else 0.01 end
w.SetWidgetValue(v_value + v_tick)
w.SetWidgetValue(v_value - v_tick)
End
Now you can just write
ForceWidgetUpdate(KNOB1)
ForceWidgetUpdate(KNOB2)
Like this?
var
KNOB1, KNOB2 : Widget
Function ForceWidgetUpdate(w : Widget)
var
v_value : double = w.GetWidgetValue()
v_tick : double = if v_value == 1.0 then -0.01 else 0.01 end
w.SetWidgetValue(v_value + v_tick)
w.SetWidgetValue(v_value - v_tick)
ForceWidgetUpdate(KNOB1)
ForceWidgetUpdate(KNOB2)
End
It complies, but its not working for me. Not sending widget value when switching back from another RS.
The call to ForceWidgetUpdate has to be made in the on Activate callback and nit in the function itself.
You built a recursion which fortunately is never called.
Your machine would explode
Ouch. No, you don’t put the call inside the function. The point of the function is to save you from writing the same code multiple times