Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 12-04-2016, 07:54 PM   #1
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default Script request: a script that can toggle/bypass a "named plugin"

Script request: Is it possible to have a script that can toggle/bypass a "named plugin" that is on all of the tracks. I have looked and so far can only find a script that can toggle/bypass the plugin that is in order>>>>> 1st, 2nd, 3rd etc, but not a named plugin.

Thanks
Ron L
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 12-04-2016, 08:24 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,967
Default

Code:
local NAME = "ReaEQ"

for ti=0,reaper.CountTracks()-1 do
  local track = reaper.GetTrack(0, ti)
  
  --[[ This would only match one FX per track
  local fi = reaper.TrackFX_GetByName(track, NAME, false)
  if fi >= 0 then
    reaper.TrackFX_SetEnabled(track, fi,
      not reaper.TrackFX_GetEnabled(track, index))
  end
  --]]
  
  -- This matches all FXs but is case sensitive unlike the above
  for fi=0,reaper.TrackFX_GetCount(track)-1 do
    local _, name = reaper.TrackFX_GetFXName(track, fi, '')
    if name:find(NAME) then
      reaper.TrackFX_SetEnabled(track, fi,
        not reaper.TrackFX_GetEnabled(track, fi))
    end
  end
end
Would a version that prompts for the FX name (instead of having it hard-coded) be useful to you? There is also room to improve the undo behavior.

Last edited by cfillion; 12-04-2016 at 08:57 PM.
cfillion is offline   Reply With Quote
Old 12-04-2016, 08:52 PM   #3
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default

Quote:
Originally Posted by cfillion View Post
Code:
local NAME = "ReaEQ"

for ti=0,reaper.CountTracks()-1 do
  local track = reaper.GetTrack(0, ti)
  
  --[[ This would only matches one FX per track
  local fi = reaper.TrackFX_GetByName(track, NAME, false)
  if fi >= 0 then
    reaper.TrackFX_SetEnabled(track, fi,
      not reaper.TrackFX_GetEnabled(track, index))
  end
  --]]
  
  -- This matches all FXs but is case sensitive unlike the above
  for fi=0,reaper.TrackFX_GetCount(track)-1 do
    local _, name = reaper.TrackFX_GetFXName(track, fi, '')
    if name:find(NAME) then
      reaper.TrackFX_SetEnabled(track, fi,
        not reaper.TrackFX_GetEnabled(track, fi))
    end
  end
end
Would a version that prompts for the FX name (instead of having it hard-coded) be useful to you? There is also room to improve the undo behavior.

This is perfect...thank you. A script that prompts for the FX name would be cool but what you have done so far works really well.

Thanks again
Ron
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 12-05-2016, 01:10 PM   #4
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default

Quote:
Originally Posted by TonE View Post
Ron L. Hubbard, I can imagine this could be useful e.g. for toggling 'scale' js, on multiple tracks, all together, useful.

How you wanted to use this?
Not sure if your question was directed at me since that isn't my full name but I will try and answer it just in case. I just purchased MMultiAnalyzer and it has to be on every track for it to work and since it will only be used in certain situations it's nice to be able to toggle/bypass all of the instances at the same time.
Have a great day
Ron Lukawitski
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 12-05-2016, 03:32 PM   #5
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default

Quote:
Originally Posted by TonE View Post
Thanks, sorry, it should be a simple joke.
No problem...humor is good
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 12-05-2016, 03:34 PM   #6
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

I've got a similar script bound to a key that lets me toggle EZDrummer no matter where it is in the project. Pretty nice.

Code:
function open_fx(plugin_name)

track_count = reaper.CountTracks(0)

	for i = 0, track_count - 1 do
	
	track_current = reaper.GetTrack(0, i)
	plugin_id = reaper.TrackFX_GetByName(track_current, plugin_name, 0)
	
		if plugin_id ~= -1 then
			
			already_open = reaper.TrackFX_GetOpen(track_current, plugin_id)
	
			if already_open then
				
				reaper.TrackFX_Show(track_current, plugin_id, 2)
				
			else
			
				reaper.TrackFX_Show(track_current, plugin_id, 3)
				
			end
			
			return
		
		end
		
	end	

end


function Main()

open_fx("EZDrummer")

end

Main()
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-05-2016, 05:49 PM   #7
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default

Quote:
Originally Posted by Lokasenna View Post
I've got a similar script bound to a key that lets me toggle EZDrummer no matter where it is in the project. Pretty nice.

Code:
function open_fx(plugin_name)

track_count = reaper.CountTracks(0)

	for i = 0, track_count - 1 do
	
	track_current = reaper.GetTrack(0, i)
	plugin_id = reaper.TrackFX_GetByName(track_current, plugin_name, 0)
	
		if plugin_id ~= -1 then
			
			already_open = reaper.TrackFX_GetOpen(track_current, plugin_id)
	
			if already_open then
				
				reaper.TrackFX_Show(track_current, plugin_id, 2)
				
			else
			
				reaper.TrackFX_Show(track_current, plugin_id, 3)
				
			end
			
			return
		
		end
		
	end	

end


function Main()

open_fx("EZDrummer")

end

Main()
Thanks for that script...it works great with Addictive Drums
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 12-05-2016, 10:04 PM   #8
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,967
Default

I've uploaded a modified version of my script above as "Toggle track FX bypass by name" to ReaTeam Scripts.

It prompts for a name, is case insensitive and creates only one undo point instead of one per FX.



Quote:
Originally Posted by TonE View Post
Prompted variants for
-fx > toggle named fx's
-tracks > toggle named tracks
-items > toggle named items
would be great.
For toggling mute of tracks by name, there is ReaConsole from SWS which does that quite well.

Last edited by cfillion; 12-05-2016 at 10:15 PM.
cfillion is offline   Reply With Quote
Old 12-06-2016, 02:57 AM   #9
ThrashJazzAssassin
Human being with feelings
 
ThrashJazzAssassin's Avatar
 
Join Date: Oct 2010
Location: Scotland
Posts: 422
Default

I know OP asked specifically for a script, but just in case you didn't know, this is how to bypass multiple plugins without a script using the Project Bay

__________________
TJA MIDI JSFX | REAPER-OSC-panels | erthoide
ThrashJazzAssassin is offline   Reply With Quote
Old 12-06-2016, 12:06 PM   #10
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default

Quote:
Originally Posted by cfillion View Post
I've uploaded a modified version of my script above as "Toggle track FX bypass by name" to ReaTeam Scripts.

It prompts for a name, is case insensitive and creates only one undo point instead of one per FX.





For toggling mute of tracks by name, there is ReaConsole from SWS which does that quite well.
Thanks...I just downloaded it
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 12-06-2016, 12:10 PM   #11
rluka
Human being with feelings
 
rluka's Avatar
 
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
Default

Quote:
Originally Posted by ThrashJazzAssassin View Post
I know OP asked specifically for a script, but just in case you didn't know, this is how to bypass multiple plugins without a script using the Project Bay


Definitely a good thing to know...Thanks for pointing that out. The current script is pretty cool also
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
rluka is offline   Reply With Quote
Old 07-09-2019, 06:39 AM   #12
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 216
Default

Quote:
Originally Posted by cfillion View Post
I've uploaded a modified version of my script above as "Toggle track FX bypass by name" to ReaTeam Scripts.

It prompts for a name, is case insensitive and creates only one undo point instead of one per FX.





For toggling mute of tracks by name, there is ReaConsole from SWS which does that quite well.
Thank you for this little gem Man !

I've got a little request though... It could be nice to have a persistant dialog window in order to toggle bypass state in and out for comparison. If it is'nt to hard to do of course

Thanks again
Nantho is offline   Reply With Quote
Old 06-15-2020, 12:26 PM   #13
RJHollins
Human being with feelings
 
Join Date: Dec 2011
Posts: 2,167
Default

Just found the 'Bypass named plugin' script ... very handy.

Request [if possible].

I use a number of AB_LM [pairs] in my FXChain. I have a custom name used for these pairs.

With the current script, the name must always be entered [each time for the pair].

Would it be possible to:

For Selected TRACK:

1. include a 'favorites' plug-in pulldown list of common plugs to Bypass/engage ?

or ... 2nd alternative ... add hard-coded names into the Script [as variables] ?


These are really the only plugin pairs that I would do a TRACK based bypass/engage with.
thanks
RJHollins is offline   Reply With Quote
Old 06-15-2020, 12:33 PM   #14
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,967
Default

Quote:
Originally Posted by RJHollins View Post
or ... 2nd alternative ... add hard-coded names into the Script [as variables] ?
The latest version of the script (v1.2 in ReaPack) includes a "create action" variant for that purpose.
cfillion is offline   Reply With Quote
Old 06-15-2020, 03:52 PM   #15
RJHollins
Human being with feelings
 
Join Date: Dec 2011
Posts: 2,167
Default

Quote:
Originally Posted by cfillion View Post
The latest version of the script (v1.2 in ReaPack) includes a "create action" variant for that purpose.
wooo .... thank-you. That's works nice
RJHollins is offline   Reply With Quote
Old 04-04-2021, 04:54 PM   #16
dna598
Human being with feelings
 
Join Date: Jul 2007
Posts: 726
Default

I have Toggle track fx bypass by name V1.2 by Cfillion.

Attempting to toggle bypass on a pair of Realearn instances on the master track.

I have renamed the instances i need to bypass, input either name on "toggle track fx bypass" and typed "MASTER" in "On tracks(name or/selected), and also tried "/selected" (while the master track is selected), but nothing works.

also tried creating the action for it, inspected the code, and edited the track and fx fields accordingly to no avail.

Any ideas what i might be doing wrong?

thank you

Last edited by dna598; 04-05-2021 at 02:52 AM.
dna598 is offline   Reply With Quote
Old 04-05-2021, 03:51 PM   #17
dna598
Human being with feelings
 
Join Date: Jul 2007
Posts: 726
Default

Quote:
Originally Posted by dna598 View Post
I have Toggle track fx bypass by name V1.2 by Cfillion.

Attempting to toggle bypass on a pair of Realearn instances on the master track.

I have renamed the instances i need to bypass, input either name on "toggle track fx bypass" and typed "MASTER" in "On tracks(name or/selected), and also tried "/selected" (while the master track is selected), but nothing works.

also tried creating the action for it, inspected the code, and edited the track and fx fields accordingly to no avail.

Any ideas what i might be doing wrong?

thank you
OK seems it just doesn't work on the master track.

If the dev is reading, any chance of getting this to work on master track?

thank you
dna598 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 08:59 PM.


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