helgoboss / helgobox

Helgobox: ReaLearn & Playtime

Home Page:https://www.helgoboss.org/projects/helgobox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to read ReaLearn source value from custom action script

aaronfay opened this issue · comments

Hello,

I'm triggering a custom Reaper script from my ReaLearn source. In ReaLearn, I can see activating the midi knob changes the value, and it is triggering my custom script, however reaper.get_action_context() is not returning any meaningful value.

Regardless of how I configure the target (relative, absolute, trigger, etc) it always shows the exact same output.

Here is my configuration:
screenshot-2023-09-02-14 04 02@2x

Here is the output of reaper.get_action_context():
screenshot-2023-09-02-14 04 15@2x

Here is the contents of the custom action TLA_relative_nudge.lua:

is_new_value,filename,sectionID,cmdID,mode,resolution,val,contextstr = reaper.get_action_context()

a = tostring(is_new_value)
b = tostring(filename)
c = tostring(sectionID)
d = tostring(cmdID)
e = tostring(mode)
f = tostring(resolution)
g = tostring(val)
h = tostring(contextstr)

reaper.ShowConsoleMsg(a .. ' ' .. b .. ' ' .. c .. ' ' ..  d .. ' ' .. e .. ' ' .. f .. ' ' .. g .. ' ' .. h .. '\n')

Can you let me know if I'm doing something incorrectly?

commented

try adjusting the character menu to one of the relative modes
if the relative modes dont work

you could try adding these command id's as part of your custom action
your/scipt
Action: Skip next action if CC parameter >=0/mid "command id 2016"
your/script
Action: Skip next action if CC parameter >0/mid "command id 2014"

not sure if it will help....

Sorry for the confusing language there, I'm not using a "custom action" in Reaper, I am using a "New ReaScript". Generally when you write a custom script you use reaper.get_action_context() to read input when the script is triggered, but regardless of how the source and target are configured (relative, absolute, trigger, etc) I still don't get any value for val, the second-last return value from get_action_context(). Normally it would have the CC value from the MIDI controller, but ReaScript doesn't appear to send anything.

I see there's a Reaper update, I'll try that next, perhaps my version of Reaper is out-of-date.

It appears my version of Reaper was out of date (Nov 2022). An update seems to have resolved the issue.

Closing.