I could use some help getting started with scripts. I have one thing I’d like to complete in my main Rackspace before I duplicated that racksspace and it’s going to require a script to do what I am after.
I want to control with a single widget (linked to a mod wheel) two different plugin parameters but in zones… something like the following… (apologies for the bad syntax)
if widget is 0-64 then parameter 42 = 0 (leslie speed is slow)
if widget is 65-127 then parameter 42 = 127 (leslie speed is fast)
if widget is 51-79 then parameter 43 = 127 (lesile is brake)
else 43 = 0 (brake is off)
Basically I have a mod wheel (in Rig Manager) that mid position should break the Leslie but if it’s in the left or right position (it’s horizontally opposed) will release the break and spin slow or fast.
I actually have two plugins with leslies I’d like to control in this manner and they use different parameter numbers from each other, of course!
Var
BRAKE : Widget
SPEED : Widget
On WidgetValueChanged(newValue : double) from SPEED
if ParamToMidi(newValue) >= 51
and ParamToMidi(newValue) <= 79 then
BRAKE.SetWidgetValue(1.0)
else
BRAKE.SetWidgetValue(0.0)
end
End
This script is working… but it doesn’t sound correct so I think it needs something to help it, perhaps a passage of time trigger and some other trickery.
This what I am experiencing now:
T-racks Leslie sounds correct going from fast to slow or fast to brake if i make the change in it’s interface (not using the mod wheel/script). I get the nice wind down sound to either.
But if i move the mod wheel with this script from fast to center for brake but wander into slow territory (anything 1 deg left of center) that still thinks it’s break territory, the sound shifts quickly to full stop and doesn’t sound natural.
Similarly, i can’t travel through break without engaging it when i don’t want to if i wanted to switch from fast to slow or vice versa… the sound jumps when it hits brake+slow or fast speed.
I think this is because the speed control is triggered at mid point on the mod wheel regardless of what the script is defining as the ParamtoMidi if/and that affects brake on/off.
I seem to be able to change the values to extremes like 5 and 122 so that i get longer mod wheel travel before i hit the speed change but what I am really after is a three zone range where the brake zone in the middle (~33% of the wheel) doesn’t have any control over the speed fast/slow… it’s the switzerland of speed control.
Additionally, the issue is that if I don’t want any brake and I go from fast to slow, I still get brake so the sound isn’t true to just changing speed, there’s an abrupt hitch in the sound instead of a wind down effect. If the brake would keep from engaging unless the wheel is left in the middle 1/3rd for 0.25 seconds perhaps… that would solve that issue.
From the manual perhaps something like this:
TimeNow() - previousTime > 1000 do
x ???
previousTime = TimeNow()
Var
BRAKE : Widget
SPEED : Widget
TimerStarted : Boolean
StartTime : double
Delay : double
initialization
TimerStarted = false
Delay = 500
SetTimersRunning(true)
end
on Activate
TimerStarted = false
SetTimersRunning(true)
end
On WidgetValueChanged(newValue : double) from SPEED
if ParamToMidi(newValue) >= 51
and ParamToMidi(newValue) <= 79 then
if TimerStarted == false then
SetTimersRunning(true)
TimerStarted = true
StartTime = TimeSinceStartup()
end
else
BRAKE.SetWidgetValue(0.0)
SetTimersRunning(false)
TimerStarted = false
end
End
on TimerTick(ms : double)
if TimeSinceStartup() >= StartTime + Delay then
BRAKE.SetWidgetValue(1.0)
end
end
Paul, that is brilliant thank you! This works exactly like what I need and it behaves exactly like the built in control on the numa organ2 works with it’s internal sound generator, which is partially what I was after… an enviroment that behaves the same if I am in VST organ or using the native sounds on the ‘controller’.
Since I want to control two leslies in two different plugins, I duplicated the widgets and edited the script to include additional BRAKE and SPEED Widgets as follows:
initialization
TimerStarted = false
Delay = 410
SetTimersRunning(true)
end
on Activate
TimerStarted = false
SetTimersRunning(true)
end
On WidgetValueChanged(newValue : double) from SPEED
if ParamToMidi(newValue) >= 20
and ParamToMidi(newValue) <= 110 then
if TimerStarted == false then
SetTimersRunning(true)
TimerStarted = true
StartTime = TimeSinceStartup()
end
else
BRAKE.SetWidgetValue(0.0)
BRAKE2.SetWidgetValue(0.0)
SetTimersRunning(false)
TimerStarted = false
end
End
on TimerTick(ms : double)
if TimeSinceStartup() >= StartTime + Delay then
BRAKE.SetWidgetValue(1.0)
BRAKE2.SetWidgetValue(1.0)
end
end
–
I couldn’t add “On WidgetValueChanged(newValue : double) from SPEED” as “SPEED, SPEED2” or a second line of this script using SPEED2 as the from or it wouldn’t compile but it works by just using SPEED as the driver for both BRAKE and BRAKE2.
I am curious if there is a way to do this, control two different plugin parameters with just one widget in the above script? I would think not based on how this works.