Old 10-23-2015, 02:23 AM   #1
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 10,410
Default Activate and Arm ALL FX parameter envelopes on selected tracks

Title says it all. As it turns out, it's a simple LUA script.

Activate and Arm all FX parameter envelopes on selected tracks

Updated to v1.01 - Thanks Justin.
Make sure Preferences / Editing Behavior / Envelope Display
Checkbox Show new envelopes in separate envelope lanes is cleared
The script is available here:
https://stash.reaper.fm/v/25508/Activ...d%20tracks.lua

How to use
  • Select your tracks

  • Execute this script

    If you did not clear Show new envelopes in separate envelope lanes, the envelopes will show up now. This could take a second or two with many envelopes. Hide them AFTER you've written you're little bit of automation.

  • Place the play cursor at the project end

  • Switch all tracks to WRITE mode

  • Hit PLAY and then STOP a second later. You have now written a bit of automation at the end of your project, and can safely write things with an end value already in place.

    If you didn't clear the Show new envelopes in separate envelope lanes in the preferences, you can now hide them with the action Envelope: Hide all envelopes for all tracks.

And here's the code for inspection :

Code:
-- Lua Script for Reaper 5.0 and up
-- Activate and arm all FX parameters on selected tracks
-- v1.01
-- Written by Anthony "Airon" Oetzmann
-- This script is public domain
-- Post your feedback and alternate versions at
-- http://forum.cockos.com/showthread.php?t=167880
function main()
  reaper.Undo_BeginBlock()

  selected_tracks_count = reaper.CountSelectedTracks(0) -- Get number of selected tracks
  if selected_tracks_count == 0 then
    dbug ("No track selected\n")
  end
  for i = 0, selected_tracks_count-1  do                -- Loop over every selected track
    track = reaper.GetSelectedTrack(0, i)               -- Get a track
    track_fx_count = reaper.TrackFX_GetCount(track)     -- how many fx on that track ?
    for j = 0, track_fx_count-1  do
      track_fxparam_count = reaper.TrackFX_GetNumParams(track, j) -- Get number of fx in track
      for k = 0, track_fxparam_count-1  do -- Loop over each parameter of this track
        -- This will create(& thus activate) and arm the FX envelope
        envelope = reaper.GetFXEnvelope(track, j, k, 1)
      end -- ENDLOOP through FX parameters
    end -- ENDLOOP through FX
  reaper.TrackList_AdjustWindows(0)
  end -- ENDLOOP through selected tracks
  reaper.Undo_EndBlock("Activate and Arm all FX Parameter envelopes on selected tracks", 0)
end

main() -- Execute your main function
reaper.UpdateArrange() -- Update the arrangement
Maybe someone can add filtering to this, so Bypass and Wet/Dry is not activated and armed. Not sure how to do that yet. This script is public domain, so do whatever you wish with it.

Problems
The script itself is fast.

Reaper however wants to display all the envelopes you have created AS SOON AS YOU WRITE TO THEM, and that's a big problem when I do this to 100 tracks with an 8-band ReaEQ and Reacomp. It takes a few seconds for those envelopes to display.

Maybe Cockos finally creates some actions to cover this. Not displaying them when they're activated would be a big plus too, so that's an option I humbly request.
__________________
Dialogue/FX Editor & Re-Recording Mixer
(Video)Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 10-23-2015 at 08:13 AM.
airon is offline   Reply With Quote
Old 11-04-2015, 08:06 AM   #2
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 10,410
Default


Write down any ideas and requests you may have in this thread. Or share you own improvements or changes. This script is public domain.

Possible improvements and alternate strategies
Activating all parameters is not always necessary.

As soon as Reaper lets you choose whether newly activated and armed envelopes appear on the track or not, I'll more often choose to let Reaper activate and arm parameters as soon as I begin adjusting them in one of the writing modes.


Improvements could be made in several ways.

First, filters, whether that's "arm only parameters containing these strings" or "exclude parameters that contain these strings", but creating the kind of string handling is a bit outside my current programming competence. Reaper has stuff like that internally already but it's likely not accessible via the API.

Hardcoded exlusion lists could of course be done. People could create different versions of the script to handle specific tasks, like automate all EQs but not the bypass of the plugins.

I still need to find out how to get plugin and parameter names. The documentation could be more detailed. It was a lot of trial and error just to get this far.
The Future
The request for Preview-like functionality has gotten attention. The use for this function is understood by the Cockos gentlemen and I'm confident this function will make it in to Reaper in the near future.

Together with envelopes no longer popping up and some smarter activation & arming procedures (simple click&swipe ala Routing-Matrix for the envelope window, right-clicking on an insert and activating&arming all its parameters) Reaper becomes an even more attractive mixing environment.
__________________
Dialogue/FX Editor & Re-Recording Mixer
(Video)Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 11-04-2015, 10:31 AM   #3
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,639
Default

Quote:
Originally Posted by airon View Post
I still need to find out how to get plugin and parameter names.
Code:
tr=reaper.GetTrack(0,0) --0=current project, 0=first track

ok,name=reaper.TrackFX_GetFXName(tr,0,"") --0=first FX name

ok,name=reaper.TrackFX_GetParamName(tr,0,0,"") --0=first fx, 0=first param name
That should help with the names bit anyway.
snooks is offline   Reply With Quote
Old 11-04-2015, 11:31 AM   #4
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 10,410
Default

Thanks. That's very helpful.
__________________
Dialogue/FX Editor & Re-Recording Mixer
(Video)Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 04-06-2016, 02:40 PM   #5
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 341
Default a very sincere thank you!

Airon, this is incredible. Thank you for making this; it kinda just changed my life!
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 08-10-2016, 08:26 PM   #6
RobinGShore
Human being with feelings
 
Join Date: May 2013
Location: New York
Posts: 371
Default

Woah. Can't believe I'm just discovering this now. I've been wanting to be able to do this forever. If there were some way the script could be modified so that it didn't include the bypass parameter that would be even more amazing
__________________
www.silversound.us
RobinGShore is offline   Reply With Quote
Old 09-07-2016, 02:27 AM   #7
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 10,410
Default

You don't say.

Might be possible now. We did get some API updates and we're all better at Lua as well. I'm just mixing and researching a lot right now, so it'll be in two weeks before begin to think about improving this.

How can we add this filter for the last parameter that includes bypass in its name ?

This code is public domain AFAIK, so anyone can mess with it, improve it, change it and hopefully put it in to one of the ReaPack repositories.
__________________
Dialogue/FX Editor & Re-Recording Mixer
(Video)Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 03-01-2017, 04:38 PM   #8
cretaceous
Human being with feelings
 
Join Date: May 2010
Posts: 122
Default

Great stuff thanks!
Been figuring someone had to have made a script for this and stumbled on this randomly after looking around for days.
Seek and ye shall find.. but only after the issue you wanted to address has been dealt with already.
cretaceous is offline   Reply With Quote
Old 11-10-2017, 05:55 PM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,058
Default

This script lacks an instruction to refresh the track list.

Add this add the end:

Code:
reaper.TrackList_AdjustWindows(false)
X-Raym is offline   Reply With Quote
Old 03-19-2018, 02:26 AM   #10
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 10,410
Default

Does anyone how to scan for parameter names yet ?

I'm starting work at the moment, so I'll check in detail tonight. I'd like to keep Bypass and Wetdry, the last two of each plugin, unactivated.
__________________
Dialogue/FX Editor & Re-Recording Mixer
(Video)Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 07-13-2018, 10:27 AM   #11
RobinGShore
Human being with feelings
 
Join Date: May 2013
Location: New York
Posts: 371
Default

Quote:
Originally Posted by airon View Post
Activating all parameters is not always necessary.

Improvements could be made in several ways.

First, filters, whether that's "arm only parameters containing these strings" or "exclude parameters that contain these strings", but creating the kind of string handling is a bit outside my current programming competence. Reaper has stuff like that internally already but it's likely not accessible via the API.

Hardcoded exlusion lists could of course be done. People could create different versions of the script to handle specific tasks, like automate all EQs but not the bypass of the plugins.

I still need to find out how to get plugin and parameter names. The documentation could be more detailed. It was a lot of trial and error just to get this far.
Quote:
Originally Posted by airon View Post
.
How can we add this filter for the last parameter that includes bypass in its name ?
Quote:
Originally Posted by airon View Post
Does anyone how to scan for parameter names yet ?
Bump to see if anyone knows how to modify this script yet to do what Airon's talking about in the quotes above. I use this script a lot and always wish there were a way for it to exclude specific parameters and plugins.
__________________
www.silversound.us
RobinGShore is offline   Reply With Quote
Old 07-13-2018, 04:04 PM   #12
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,442
Default

Quote:
Originally Posted by RobinGShore View Post
Bump to see if anyone knows how to modify this script yet to do what Airon's talking about in the quotes above. I use this script a lot and always wish there were a way for it to exclude specific parameters and plugins.
In post #3 snooks showed how to get fx name and fx parm name, isn't that all you'd need? I imagine you'd make an array of names so when looping it could then check if those names match the fx/params so you could skip them or whatever.

BTW been wanting to make a script like this for long time (Thanks airon and snooks)! My projects are very small with a few FX, so I just mod'd the script to ask me if I want to add the param as envelope with a cancel button so it can skip the FX/remaining params for current FX it looping thru.

EDIT Updated my script, v1.02
No longer asks to add a param if already added.
Msgbox title bar displays Track# and FX#.
https://stash.reaper.fm/34333/Ask%20...d%20tracks.lua

Last edited by Edgemeal; 09-17-2018 at 06:07 PM.
Edgemeal is online now   Reply With Quote
Old 06-27-2019, 03:10 AM   #13
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 10,410
Default

We could present two text boxes, the first for filtering plugin names, the second for filtering parameter names. That way, more targeted activation and arming may be possible. The results would need to be displayed as well.

Has anyone done this kind of filtering and result display ?
__________________
Dialogue/FX Editor & Re-Recording Mixer
(Video)Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 06-27-2019 at 03:30 AM.
airon 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 02:27 PM.


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