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: 236
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 http://www.ronlukawitski.com
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: 2,682
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: 236
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 http://www.ronlukawitski.com
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: 236
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 http://www.ronlukawitski.com
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: 236
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 http://www.ronlukawitski.com
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,028
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()
Lokasenna is online now   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: 236
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 http://www.ronlukawitski.com
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: 2,682
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: 353
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: 236
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 http://www.ronlukawitski.com
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: 236
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 http://www.ronlukawitski.com
rluka is offline   Reply With Quote
Old 07-09-2019, 06:39 AM   #12
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 100
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
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 09:12 AM.


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