View Single Post
Old 03-13-2019, 03:44 PM   #5833
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Quote:
Originally Posted by woodslanding View Post
In the 'is it possible' camp:

Can I have a knob run a lua script that takes a value on input?

For instance, could I create a knob that selects tracks?
Code:
tracknum = value of knob   --how do I get the knob value from stripper?
track = reaper.GetTrack(0, tracknum)  
reaper.SetOnlyTrackSelected(track)
Yep - you need to use the new State Control (numeric) type (find in TRACK EDIT->Other Controls list).

Drag the control into Strip - right-click it (when in edit mode) - choose Set State Info option from menu.

Then choose an External State Name, and a Key. You can use the state name and key you choose in an external script using the GetExtState API to retrieve the value.

Now to trigger the action when the control changes - you need to combine the control with an Action Trigger (using a Macro Control - also in Other Controls list).

So add an Action Trigger control - and right-click it and set it to the correct action from the action list (several ways to do this - easiest is probably selecting the action in the open Action List (in Reaper) and then choosing the 'Assign Command ID from selected item in Action list' option.

Add a macro control.

In live mode - right-click the macro control to edit it.

Click Add Parameters button - add first the State Control to the macro control - then the action trigger control - it's important the action is triggered last.

Finally - for neatness - go back into EDIT mode - and hide the state control and action trigger controls - so you should just require the macro control to both change the value and trigger the action/script.

I've not tried this out exactly - but have done similar things.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote