Quote:
Originally Posted by nolman
This is so awesome!
johnrule, could you show me how to form the release scripts ?
suppose i make a button for recenable ch1, what would the script be?
or to toggle the metronome on/off?
many thanks in advance!
|
Sorry for the delay...I was programming.
Here is a quick example for now:
- Open the 'Reaper_Control.rte' project in the 'Examples' folder.
- Open the 'Script Window' (you can right-click on an object and choose 'Script/Release' too).
- Choose the 'Arrow' tool for selecting, and click on any button to refresh the Script Window with that objects script.
The SEND.STRING has three parameters:
Code:
SEND.STRING(socket, string, delay);
For Reaper control, you just need the 'string', so in this animation you see "" for the first parameter and '0' for the last...the string is what I am highlighting.
The protocol can be pretty simple. For example, for 'Play', you only need the string "/_/1007;" to actually trigger Reaper. SO the SEND.STRING would look like this:
Code:
SEND.STRING("", "/_/1007;", 0);
And when you convert that project to html, it is embedded in the page for you as a GET command.
A more advanced string is something like the track mute or solo. You can chain commands as long as you separate them with a semi-colon ";" like this:
Code:
SEND.STRING("", "/_/SET/TRACK/0/MUTE/-1;TRACK/0;TRANSPORT;", 0);
That is the Master mute command. The "/_/SET/TRACK/0/MUTE/-1;" is the actual command to mute, and the "TRACK/0;" is the command to get the status on that track. The "TRANSPORT;" command tells Reaper to send it as soon as it can.
One last example. To toggle mute and toggle solo for channel 1 you would use the following commands:
Code:
// Mute
SEND.STRING("", "/_/SET/TRACK/1/MUTE/-1;TRACK/1;TRANSPORT;", 0);
// Solo
SEND.STRING("", "/_/SET/TRACK/1/SOLO/-1;TRACK/1;TRANSPORT;", 0);
The "-1" is a toggle command, and a discrete "1" or "0" will force it to that state.
The complete protocol that Justin slaved over is explained in great detail in the "main.js" file in the "reaper_www_root" folder.
Enough?