Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 07-13-2020, 05:01 PM   #1
nscotto
Human being with feelings
 
Join Date: Jul 2020
Posts: 84
Default Open/close FX #-1 from last selected track

Hi everyone!

First question here, I've finally passed the mental barrer of the the early steps in reaper and I'm getting into customization mode, seems like a whole new world is opening to me!

I didn't find in the action list a way to open/close FX from last selected track starting with indexing starting from the end of the FX chain (reverse order).
Can someone help me doing this?

Cheers!

PS: I am a coder so not afraid of writing a script for doing if that's the way to do it.

Last edited by nscotto; 07-13-2020 at 06:11 PM.
nscotto is offline   Reply With Quote
Old 07-13-2020, 06:25 PM   #2
xpander
Human being with feelings
 
xpander's Avatar
 
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
Default

Quote:
Originally Posted by nscotto View Post
I didn't find in the action list a way to open/close FX from last selected track starting with indexing starting from the end of the FX chain (reverse order).
I'm not sure if this would help any, but SWS/S&M: Float previous FX (and close others) for selected tracks starts opening from the last FX in a chain and cycles backwards. SWS/S&M: Float next FX (and close others) for selected tracks does the opposite.

Welcome to the forums.
xpander is offline   Reply With Quote
Old 07-13-2020, 11:34 PM   #3
nscotto
Human being with feelings
 
Join Date: Jul 2020
Posts: 84
Default

Thank you, that's perfect!

It was just for having shortcuts for opening meters on the master track, the meters are always att the end of the chain with evenutally some other FX before.
So to open the last one I just open the first and then the previous.
Neat!

Edit: mmmh... not exactly it. My custom action doesn't behave like a toggle, after I opened the plugin, if I trigger the action again it keeps cycling instead of closing the plugin...
Here is the action:
- SWS: Select master track
- Open/Close FX 1 for last selected track / SWS/S&M: Float FX 1 for selected track / SWS/S&M: Toggle Float FX1 1 for selected track
- SWS/S&M: Float previous FX (and close others) for selected tracks
- SWS: Unselect master track

It would be nice if I could access the plugin list in LUA and toggle the plugin UI from here, that would be the best solution IMO.

Last edited by nscotto; 07-13-2020 at 11:51 PM. Reason: I though it was working
nscotto is offline   Reply With Quote
Old 07-14-2020, 04:09 AM   #4
xpander
Human being with feelings
 
xpander's Avatar
 
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
Default

Quote:
Originally Posted by nscotto View Post
not exactly it. My custom action doesn't behave like a toggle, after I opened the plugin, if I trigger the action again it keeps cycling instead of closing the plugin...
Ok, for toggling between different actions you would need to use SWS cycle actions. For that you need to have installed SWS Extensions, which is highly recommended.

With cycle actions you can not only build toggle actions, but also include e.g. conditions (IF, IF NOT). Some examples: https://forum.cockos.com/showpost.ph...postcount=1136

Now if you have the metering plugin as the last FX of the chain and you want to toggle that on/off, cycle action like this should work:
SWS/S&M: Float previous FX (and close others) for selected tracks
---step---
SWS/S&M: Close all floating FX windows for selected tracks


Even more is possible with scripts. For discussions about scripting, ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum would be a place to visit.
xpander is offline   Reply With Quote
Old 07-14-2020, 12:07 PM   #5
nscotto
Human being with feelings
 
Join Date: Jul 2020
Posts: 84
Default

Couldn't make it with custom actions, as described it had side effects and didn't just toggle the windows I wanted... Didn't about the conditions though, that's cool!

Here's how it looks like:

For toggling the first FX from the end (change idx to 2 for second, etc.):
```
idx = 1

master_track = reaper.GetMasterTrack(0)
fx_count = reaper.TrackFX_GetCount(master_track)
fx = fx_count - idx

function toggle_fx(track, fx)
local toggle = not reaper.TrackFX_GetOpen(track, fx)
reaper.TrackFX_SetOpen(track, fx, toggle)
end

toggle_fx(master_track, fx)
```

Bonus, keep FX disabled and enable it when opening using the script (for saving some cpu):
```
idx = 1

master_track = reaper.GetMasterTrack(0)
fx_count = reaper.TrackFX_GetCount(master_track)
fx = fx_count - idx

function toggle_enable_open_fx(track, fx)
local toggle = not reaper.TrackFX_GetEnabled(track, fx)
reaper.TrackFX_SetEnabled(track, fx, toggle)
reaper.TrackFX_SetOpen(track, fx, toggle)
end

toggle_enable_open_fx(master_track, fx)
```
nscotto 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 04:08 AM.


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