Old 02-20-2018, 09:05 PM   #1
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default Deploy and execute ReaScript over LAN

The idea is to be able to use a network computer (with Reaper and plugins installed aka "remote host").
Then in the DAW session of my local workstation (running say Ableton) invoke instruments and effects as a service from the remote host.

The part of the jigsaw I'm asking about in this thread is the means by which I load and execute the reascript over the network on the side of the remote host. The reascript sets up the channel instrument and plugins as requested.

I understand that I will need to code a VST plugin that runs in the local DAW session to somehow deploy and execute the Reascript over the network.

I suppose one way would be to have the locally generated script copied into the REAPER/scripts folder of the remote host over the network, then to execute the script using a predetermined midi mapped action trigger?
Maybe there is a much more elegant method?
Thanks for any comments...
Guod3 is offline   Reply With Quote
Old 02-20-2018, 09:49 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

You can remotely run actions including scripts via HTTP using the Web Interface feature.

Preferences > Control/OSC/Web. See main.js at the root for documentation.

Last edited by cfillion; 02-20-2018 at 09:57 PM.
cfillion is offline   Reply With Quote
Old 02-20-2018, 11:37 PM   #3
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

Thanks for the response, that seems to be the kind of thing I'll need.

Sorry for the naive questions:
The *.html files represent examples (client side) of a client interacting with the server?
The main.js determines the behaviour of the server. I could not work out how to load main.js (as a control script presumably).
In my implementation code, (a client side process using html protocol) there will be a way of transferring and executing a *.lua Reascript in the server (running my a modified version of main.js)?

If this is the case, then I think I can learn enough html and javascript to perform this simple interaction, but I need to know if my understanding is on the right track.
Guod3 is offline   Reply With Quote
Old 02-21-2018, 09:55 PM   #4
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

O.k I (finally) saw the "Web Browser interface" on the list of control surface scripts in the control surface settings.
I see how it serves the html pages to the client browser and allows it control aspects of reaper.
My application will be sending HTTP to this web address to control Reaper, particularly loading and executing lua scripts.
I'll study main.js more closely now....
Guod3 is offline   Reply With Quote
Old 02-22-2018, 01:23 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

You can consider the reaper web interface builder to build your own remote control:
https://reaperblog.net/2017/11/reaperwrb-announce/

:P
X-Raym is offline   Reply With Quote
Old 02-22-2018, 07:38 PM   #6
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

Quote:
Originally Posted by cfillion View Post
You can remotely run actions including scripts via HTTP using the Web Interface feature.

Preferences > Control/OSC/Web. See main.js at the root for documentation.
After studying things it seems to me there is no built in way to transfer scripts using the Web Interface.

As far as triggering (over LAN) actions that contain scripts there are simpler ways of doing this (for me, at least and in the short term).

Here's how I see it working:
1) configuration:I map a network drive to the Reaper scripts folder on the server.
2) configuration: I create a midi mapped action to run "Temp.lua"

Whenever the plugin wants to configure channels, FX, or instruments on the server it encodes the setup in Temp.lua then does (3) an(4)

3) operation: My plugin in a local DAW session copies Temp.lua to the network drive.
4) operation: the plugin triggers the action over an RtpMidi port.

Once my system is up and running, the Web Interface could be really useful for displaying visual status of what going on in the server.
Guod3 is offline   Reply With Quote
Old 02-22-2018, 08:48 PM   #7
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Does the script really needs to be replaced dynamically? It sounds like just telling one script what to do could suffice. This can be done from the web interface by setting temporary EXTSTATES before running it. (You could probably transmit code this way too If absolutely needed but that's probably not a good idea...)

Code:
http://reapercomputer:8080/_/SET/EXTSTATE/the_script/add_fx/reaeq
http://reapercomputer:8080/_/SET/EXTSTATE/the_script/set_channels/4,5
http://reapercomputer:8080/_/_CommandIDOfTheScript

Last edited by cfillion; 02-22-2018 at 09:24 PM.
cfillion is offline   Reply With Quote
Old 02-22-2018, 09:17 PM   #8
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

Thanks I'll study this.

As for dynamic replacement, that is at the heart of what I'm doing.
My local DAW (running Ableton) has a special plugin (I am developing) for hosting externally hosted instruments. The instruments including channels and FX are running on a Reaper session on the remote host computer.

As I envisage it, my hosting plugin contains all the information necessary to configure the Reaper channels and insert instruments and FX (this is in Temp.lua) specific to the how the plugin instance has been set to in a particular Ableton session. I don't want to be tied down to particular scripts. I want to be able to load an Ableton session in years time and have the setup reaper session be the same, even though my plugin is now capable of more intricate sophisticated setups...

The aim is to have the remote Reaper host as dumb as possible, just plugins installed and an absolute minimum settings to make it operational. All state memory is in the plugin stored in the local Ableton session.
Guod3 is offline   Reply With Quote
Old 02-23-2018, 06:01 PM   #9
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

Quote:
Originally Posted by cfillion View Post
Does the script really needs to be replaced dynamically? It sounds like just telling one script what to do could suffice. This can be done from the web interface by setting temporary EXTSTATES before running it. (You could probably transmit code this way too If absolutely needed but that's probably not a good idea...)

Code:
http://reapercomputer:8080/_/SET/EXTSTATE/the_script/add_fx/reaeq
http://reapercomputer:8080/_/SET/EXTSTATE/the_script/set_channels/4,5
http://reapercomputer:8080/_/_CommandIDOfTheScript
I think I understand now. If the commands over Web Interface can do anything that the commands of a script could do, then the required setups can be achieved using the Web Interface without the need to transmit whole scripts to Reaper?
Guod3 is offline   Reply With Quote
Old 02-26-2018, 01:04 AM   #10
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

Simple but important question: can any reaper API function be called through the Web Interface?
Guod3 is offline   Reply With Quote
Old 02-26-2018, 12:21 PM   #11
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Not directly: the full API is only available to scripts. But you can run script with arbitrary data through the web interface, so yes you have access to the whole API.
cfillion is offline   Reply With Quote
Old 05-12-2018, 02:34 PM   #12
filtah
Human being with feelings
 
Join Date: Apr 2006
Posts: 13
Default

Quote:
Originally Posted by cfillion View Post
Not directly: the full API is only available to scripts. But you can run script with arbitrary data through the web interface, so yes you have access to the whole API.
Cool. is it also possible to get a response back from the script? if so, what kind of data can be returned? json?

thanks, really need to dig into this and find out!
filtah is offline   Reply With Quote
Old 05-14-2018, 10:13 PM   #13
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Yes, the script can also write data (SetExtState) that can be read through the web interface (/_/GET/EXTSTATE/section/key). You can write any data you want.
cfillion is offline   Reply With Quote
Old 10-25-2022, 08:18 PM   #14
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

This might be more what I'm looking for. If I enable the web interface in Reaper would I be able to run scripts in Reaper from another local audio application ?
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 10-25-2022, 08:23 PM   #15
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Yes, the web interface can trigger scripts or any other action. It depends only on whether that "other local audio application" can do HTTP requests to it.
cfillion is offline   Reply With Quote
Old 10-25-2022, 08:43 PM   #16
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

It's Band In A Box it connects to the internet to play demos etc.. it also connects to a remote control over ip as well as a Android iPhone Biab app that sends chord info to the main application running on your desktop then it sends the m4a song back to your phone using a bbserver.exe that needs to be running but I don't know if it would need that for a local connection.

https://www.pgmusic.com/support.android.htm


I'm trying to get PG to implement this so it will send the tracks directly to Reaper like I do now using the Biab track injector but Reaper runs autohotkey scripts to control Band In A Box to get the track info from the txt file Band In A Box outputs to a folder..
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 10-25-2022 at 09:00 PM.
MusoBob is offline   Reply With Quote
Old 10-26-2022, 03:23 AM   #17
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Guod3 View Post
Simple but important question: can any reaper API function be called through the Web Interface?
All actions can be called, all extstates as well as ProjectExtstates can be accessed, but no Api, as cfillion mentioned.

Here's my docs about it, including some very basic examples:

https://mespotin.uber.space/Ultrasch...mentation.html
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 10-26-2022 at 03:45 AM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-26-2022, 05:34 AM   #18
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

Quote:
Originally Posted by MusoBob View Post
It's Band In A Box...
Interesting !

Is BiaB programmable in any way ?

You seemingly want to have BiaB do definable HTTP request towards a definable HTTP server. Do you suppose there is any chance to make it do that ?

-Michael
mschnell is online now   Reply With Quote
Old 10-26-2022, 02:56 PM   #19
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Not programmable, but just have to try and ask them, please !

Thanks guys, that's great.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   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 12:31 PM.


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