Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 06-14-2018, 10:23 AM   #1
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,620
Default API: Access to "ReaScript: Run reaScript (EEL, lua, or python)..."

Since some tasks are better suited for one scripting language over another (Lua for ease of writing and better GUI capabilities, EEL for audio processing, etc), it would be really handy if scripts of different languages could call each other just like a user clicking ReaScript: Run reaScript (EEL, lua, or python)... on their own.

At a basic level, it could look like:
Code:
--Lua script

reaper.SetExtState("my_script", "vars", "1,5,a")
reaper.RunReaScript("Scripts/my_other_script.eel")


-- EEL script (written as Lua because I suck at EEL)

vars = reaper.GetExtState("my_script", "vars")
retvals = do_some_complicated_audio_processing_using(vars)
reaper.SetExtState("my_script", "retvals", retvals)


--Lua script

reaper.defer(keep_checking_for_ExtState_retvals)
reaper.ShowConsoleMsg("Got the following retvals: " .. retvals)
Or, if some kind, generous, and sexy developer felt like it, passing arguments back and forth to avoid all the ExtState business:

Code:
--Lua script

local retvals = reaper.RunReaScript("my_other_script.eel", arg1, arg2, etc)
Cheers.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Old 06-14-2018, 10:28 AM   #2
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 2,550
Default

Quote:
Originally Posted by Lokasenna View Post

Or, if some kind, generous, and sexy developer felt like it, passing arguments back and forth to avoid all the ExtState business:

Code:
--Lua script

local retvals = reaper.RunReaScript("my_other_script.eel", arg1, arg2, etc)
This would be amazing!!
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine | LBX Floating FX Positioner | LBX SRD Smart Knobs
Donate via Paypal
lb0 is offline   Reply With Quote
Old 06-14-2018, 12:00 PM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,779
Default

+1. !!
X-Raym is offline   Reply With Quote
Old 06-15-2018, 06:22 AM   #4
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,185
Default

Yes please!!
amagalma is offline   Reply With Quote
Old 06-15-2018, 07:00 AM   #5
mespotine
Human being with feelings
 
Join Date: May 2017
Posts: 201
Default

+1000
Especially the parameter/avoiding extstate-stuff

@lokasenna
Regarding your first FR, do you mean, mixture of several programming languages in one script, so ReaScript would treat the individual parts of the code as individual scripts during execution?
mespotine is offline   Reply With Quote
Old 06-15-2018, 07:33 AM   #6
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,620
Default

Quote:
Originally Posted by mespotine View Post
+1000
Especially the parameter/avoiding extstate-stuff

@lokasenna
Regarding your first FR, do you mean, mixture of several programming languages in one script, so ReaScript would treat the individual parts of the code as individual scripts during execution?
Sort of - being able to call an EEL script from a Lua script. They would be completely separate processes, which we can already do manually:

- Run the Lua script
- Have it store some variables
- Use the action list to run the EEL script
- Have it load the variables and do stuff
- Have it save the returned value
- Have the Lua script waiting with a defer loop until it sees the returned value as an ExtState

At the moment we can do this via Main_OnCommand if the EEL script is registered as an action, whereas being able to call them directly would mean only your "main" script needs to show up. If a script had several different audio processing features written in EEL with a Lua frontend, direct access would be much simpler.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.