Old 06-23-2019, 12:51 AM   #1
Human being with feelings
Join Date: Jun 2019
Posts: 1
Default Use DAW information in JSFX script

Is it possible for a JSFX script to do something based on the state of the transport panel? For example an if statement such as: if the DAW is recording then...?

Also is it possible for a JSFX script to change the mute, solo and record states of the channel it is on?
therecordingguy is offline   Reply With Quote
Old 06-23-2019, 01:13 AM   #2
Human being with feelings
mschnell's Avatar
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,056

Welcome to ther Reasper Forums !

JSFXes can't directly access the Reaper API (only by the dedicated variable provided). They just work on audio and Midi streams . (The technical cause is that they work on the Track's audio thread and not on the GUI thread.)
To do things like "mute" you can (e.g.) send out a Midi CC message in the JSFX, use the "MidiToReaControlPath" VST plugin to route that information to the Reaper Control Path where an Action can see it, and do a miniature Reascript to exectute whatever you want.

Regarding mute/unmute an appropriate script is available via ReaPack. Unfortunately right now I have no idea how to propagate the information which track sent the message .

mschnell is online now   Reply With Quote
Old 06-23-2019, 02:04 AM   #3
Human being with feelings
solger's Avatar
Join Date: Mar 2013
Posts: 3,809

Welcome to the Reaper forums!

Can you post more details or an example of what you're trying to do, exactly?

In general, there are already some toggle Actions and scripts available (for Mute, Solo, Record Arm, etc.) in the Action List (https://www.reaper.fm/videos.php#tzg9fifza0s) and ReaPack (https://reapack.com/).
Depending on the use case, a Cycle Action (part of the SWS Extensions: http://www.sws-extension.org/) can also be a viable option for if/else statements (besides using scripts). Just as example: https://www.youtube.com/watch?v=9LdjO5yyl2M

Last edited by solger; 06-23-2019 at 02:32 AM.
solger is offline   Reply With Quote
Old 06-23-2019, 03:58 AM   #4
Human being with feelings
mpl's Avatar
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,542

You can trigger anything possible with ReaScript using JSFX. Although for such cases you have to use some persistent ReaScript tracking changes in some global memory space (shared and accessible with JSFX). And it could be a little bit tricky to let ReaScript know which instance of JSFX triggered command .
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote

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 02:45 PM.

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