Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 04-20-2021, 08:57 AM   #1
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,927
Default Action (or small script) that opens specific FX

Is there a way to toggle open/close the GUI for an FX with a specific name on the selected track?

Basically I just want to open a certain FX on the selected track with a control surface, but that FX won't always be in the same FX slot. And opening the FX chain window won't necessarily display the correct GUI if there are multiple FX on the track.
valy is offline   Reply With Quote
Old 04-20-2021, 10:14 AM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
Default

ReaPack > Add Fx by Name in selected tracks (a description of settings inside script) (by Archie) or Add fx by name to selected track (by me2beats) seems to fit (not used myself...).

edit:
Ah scratch that, you're looking for opening, not adding, sorry.
nofish is offline   Reply With Quote
Old 04-20-2021, 02:16 PM   #3
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,927
Default

Right, and I'm not even sure if instantiated track FX names are exposed to the API. For instance, this seems like it just works off the FX slot number:

Quote:
C: void TrackFX_SetOpen(MediaTrack* track, int fx, bool open)

EEL2: TrackFX_SetOpen(MediaTrack track, int fx, bool open)

Lua: reaper.TrackFX_SetOpen(MediaTrack track, integer fx, boolean open)

Python: RPR_TrackFX_SetOpen(MediaTrack track, Int fx, Boolean open)

Open this FX UI. See TrackFX_GetOpen
For now I am going to use the action "Track: Open/close UI for FX #1 on last touched track," since the FX actually will be in the first slot a large portion of the time. In cases where it isn't, I will have to use the mouse for now.
valy is offline   Reply With Quote
Old 04-21-2021, 07:55 AM   #4
AB1
Human being with feelings
 
Join Date: Apr 2020
Location: UK
Posts: 79
Default

This will toggle open/close for the GUI of the first instance of the named FX on the first selected track. The chosen FX does not need to be first in the FX stack.

Code:
fxName = "<insert FX name here>"
trk = reaper.GetSelectedTrack(0, 0)
fxIndex = reaper.TrackFX_AddByName(trk, fxName, false, 0)
isOpen = reaper.TrackFX_GetOpen(trk, fxIndex)
if isOpen == true then
  reaper.TrackFX_Show(trk, fxIndex, 2)
else
  reaper.TrackFX_Show(trk, fxIndex, 3)
end
AB1 is offline   Reply With Quote
Old 04-21-2021, 07:13 PM   #5
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,927
Default

Quote:
Originally Posted by AB1 View Post
This will toggle open/close for the GUI of the first instance of the named FX on the first selected track. The chosen FX does not need to be first in the FX stack.

Code:
fxName = "<insert FX name here>"
trk = reaper.GetSelectedTrack(0, 0)
fxIndex = reaper.TrackFX_AddByName(trk, fxName, false, 0)
isOpen = reaper.TrackFX_GetOpen(trk, fxIndex)
if isOpen == true then
  reaper.TrackFX_Show(trk, fxIndex, 2)
else
  reaper.TrackFX_Show(trk, fxIndex, 3)
end
Wow, thank you very much! Works perfectly!!!
valy is offline   Reply With Quote
Old 04-22-2021, 01:28 AM   #6
AB1
Human being with feelings
 
Join Date: Apr 2020
Location: UK
Posts: 79
Default

You're welcome. For anyone not used to this sort of thing, it's worth noting that reaper.TrackFX_AddByName "Adds or queries the position of a named FX...", which is not obvious from the function name.
AB1 is offline   Reply With Quote
Old 04-22-2021, 07:18 AM   #7
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,927
Default

Quote:
Originally Posted by AB1 View Post
You're welcome. For anyone not used to this sort of thing, it's worth noting that reaper.TrackFX_AddByName "Adds or queries the position of a named FX...", which is not obvious from the function name.
I had noticed that description in the API, but was unsure what it actually did. Thanks again! Really appreciate that.
valy 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 05:36 AM.


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