Old 08-11-2015, 05:58 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default Scripts: FX Param Values (various)

Hi !

Here will be put my FX param values related scripts.

Let's start !

Script 1

  • X-Raym_Set selected tracks fx parameters values from last focused fx.lua
  • X-Raym_Set selected tracks fx parameter value from last focused fx last touch parameter.lua

Context :
While I was mixing a fake chorus (each tracks is one singer only), I was looking for a way to propagate values of a an FX to other tracks.
I don't know how I could do it without deleting and copy the fx several times, or by creating FX presets, so I made this script.

Screenshot





Do you think it is useful ?
How do you usually work in this case ?
Anyway, unless I missed something, it can be faster than a simple click on RUN button :P But I'm interested on other possible solutions.

Check below for running in backroud real time update spk77 version !

EDIT: 2018-07-05
I also made my own real-time version which is a bit different. More info here.
  • X-Raym_Set selected tracks FX parameters values from last focused FX (real-time).lua
  • X-Raym_Propagate last focused FX parameters values but bypass to similarly named FX on child tracks (real-time).lua


Last edited by X-Raym; 07-06-2018 at 03:43 PM.
X-Raym is offline   Reply With Quote
Old 08-11-2015, 10:49 AM   #2
babag
Human being with feelings
 
Join Date: Nov 2009
Posts: 2,230
Default

yes. it seems similar to some workflow i've been developing. been using global sliders js fx but this would be better probably.

as you, i've been trying to apply fx parameters across tracks. i also want to retain control of individual parameters on the individual tracks.

one added wrinkle to what i do, relative to this posting, is that i work mostly with envelopes. what i'd like is to stay in my tracks and timeline but have access to my fx parameters through envelopes. to that end, i've been working on trying to place specific envelope parameters in specific time selections or regions, say, verse and chorus or, for video post, different scenes. i'd like to be able to set effect parameters, then apply them across selected tracks, placing envelope points at the time selection or range. that way i could simply grab the envelope for any one of the parameters on any of the tracks and individually tweak it for the duration of the selection or region.

main thing is just a bit more development than what you've, so far, posted. i'd just add the placing of envelope points at time selection/region on selected tracks. bottom line, though, in response to the question of how useful this is, is very useful.

something else useful when working with envelopes would, for me, be to have the ability to store and recall multiple envelope views. i'd like to be able to, with the touch of a tool button or key command, call up reasurround envelopes or reacomp parameters or reaeq, etc., while hiding the others. that would make for an ideal workflow for me:

generate fx parameters envelopes across tracks
show/hide various parameters based on what i'm working with at the time

thanks,
BabaG

Last edited by babag; 08-11-2015 at 11:02 AM.
babag is offline   Reply With Quote
Old 08-11-2015, 11:18 AM   #3
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

anything that could copy fx settings from one track to another would be VERY helpful to me. Any way to make it propagate to similarly NAMED fx?
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 12:25 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@babag
Thanks you for sharing your method.
I also think about envelope on my script for copy paste multiple envelope accross track (with time selection support), but I wanting something cleaner.

I can make a version that would only works for last touch parameter

@Jason
Actually, it already works by comparing FX name.
X-Raym is offline   Reply With Quote
Old 08-11-2015, 12:39 PM   #5
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

I would love it if it didn't need plugins to be in focus, however.
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 12:50 PM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Jason
Absolutely no need to be in focus, it works with the LAST focused, once it get focused once, you can close it, run it from action list etc...

@all

Check screenshot above, I showcase a version wich works with last touched param only
X-Raym is offline   Reply With Quote
Old 08-11-2015, 01:06 PM   #7
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

I NEED THIS NOW.

thanks man!!!
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 05:55 PM   #8
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Jason
Initial release of the scripts, you can download them on my website (link to my script pack in my signature) !

Last edited by X-Raym; 08-11-2015 at 06:37 PM.
X-Raym is offline   Reply With Quote
Old 08-11-2015, 06:34 PM   #9
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

what did you mean?
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 06:36 PM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Jason
I wanted to say that my english is not always as good as I think haha :P
I edited the previous post with better syntax.
X-Raym is offline   Reply With Quote
Old 08-11-2015, 06:53 PM   #11
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

ok, using it with SLATE vmr... good results. Now I'm trying to think of a workflow.

It would be neat to have it "armed" on or something - so that it continually updates at a certain frequency while you have it "armed" -

so you can audition double tracked guitars, for instance.

it does what it says, however!

what about "all tracks" and not just selected tracks? This way we could name certain FX as part of a group and just quickly apply the changes?

btw, please do not worry about your english. I just didn't get it
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 06:56 PM   #12
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

or wait - what if it could check TRACK names first?
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 06:57 PM   #13
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

like this:

1. I change a parameter in one plugin
2. I run your command
3. It looks for other tracks with a similar name (or under a similar folder)
4. It searches THOSE tracks only for FX which match the name of the FX it's being copied from
5. it changes those parameters.
Jae.Thomas is offline   Reply With Quote
Old 08-11-2015, 10:42 PM   #14
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Jason
Nice it woks for you !

The idea behind make it work with selected track is modularity : you can then put the script inside any macros you want so that it works on all tracks (put Select all tracks action first) or more complex selecting tracks actions (based on name, or track color or whatever you want)

A running in backcground version of this would be without any doubt too cpu intensive, even a low rate. Some effects have a lot of parameters, some tracks has a lot of effects and some projects have a lots of tracks.
So i don't plan to make this kind of adaptation.
That said, I encourage anyone who would try a mod. It is the only way to know :P
X-Raym is offline   Reply With Quote
Old 08-12-2015, 07:14 AM   #15
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

makes perfect sense -

so, are there actions which select "similarly named tracks" ?
Jae.Thomas is offline   Reply With Quote
Old 08-12-2015, 09:18 AM   #16
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Jason
You can do that with the SWS console
X-Raym is offline   Reply With Quote
Old 08-14-2015, 08:32 AM   #17
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

how can i do that?
Jae.Thomas is offline   Reply With Quote
Old 08-14-2015, 08:33 AM   #18
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Jason

The SWS ReaConsole Basic Overview Tutorial

X-Raym is offline   Reply With Quote
Old 08-14-2015, 08:37 AM   #19
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

nice, thank you. Would still be nice to have some actions to select tracks, so I made a different thread.
Jae.Thomas is offline   Reply With Quote
Old 08-18-2015, 08:51 PM   #20
casrya
Human being with feelings
 
Join Date: Dec 2013
Location: Melbourne, Australia
Posts: 96
Default

Hi X-Raym,

This is a cool idea and I am sure I will be able to use it so thanks

Something I have done manually before which is similar and would love to do with a script is to map all of the params from one FX instance to another via parameter modulation (link from parameter). A use case where you might want to do this is where you are using multiple instances of a mono synth to obtain polyphony and want to tweak the synth params in real time.

I had a quick look in the API and couldn't see an obvious function to do this but thought I would put it out there as an idea for the scripting experts such as yourself!

Cheers,

casrya
casrya is offline   Reply With Quote
Old 08-19-2015, 03:19 AM   #21
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@casrya
I have to admit that this would be a nice idea, but unfortunately, as far as I know, there is no API related to parameter modulation =/
We have to use modified tracks XML chunk directly (there is a function for that), but it is not very convenient at all. =/

Here is a code example of what it looks like :
Code:
      <PROGRAMENV 1 0
        PARAMBASE -150
        LFO 0
        LFOWT 1 1
        AUDIOCTL 0
        AUDIOCTLWT 1 1
        PLINK 1 0:0 0 0
        MODWND 1 296 244 644 516
      >
This means something like move the second parameter with the first one (same plugin), with an offset of 150..

But a deeper problem : parameters can be modulate by other parameters but only on the same track, as explained in this FR :

Parameter Modulation ++

So, it may be possible to make it work on the same track, but it would be really difficult to implement without proper functions in the API. And for different track, it is not possible with parameter modulation.
X-Raym is offline   Reply With Quote
Old 08-22-2015, 03:21 AM   #22
casrya
Human being with feelings
 
Join Date: Dec 2013
Location: Melbourne, Australia
Posts: 96
Default

Thanks for the info X-Raym! I am an experienced programmer so decided to do some investigation and write the script (see attachment) since I thought it would be interesting because I have never written Lua before. The biggest issue I encountered was that the so called RPPXML is not XML at all, meaning it has to be parsed manually without help of an XML parser. However, Lua has decent String manipulation so it was not so bad once I figured out the regular expression syntax.

I have attached the script which is fairly well commented and it includes usage info and error messages for the scenarios I could think of so it could be of interest to others and maybe give ideas for other scripts.

I actually think I will end up putting it to uses I haven’t thought of before given that reaper tracks are so powerful with multiple channels and multiple MIDI busses. As such, with clever routing, parameter modulation being confined to a single track might not be as much of a limitation as it initially appears.

One other note, large numbers of parameters can become CPU intensive. For example I tried it on z3ta+ 1.5 which has 587 parameters and with four instances being modulated it hit 40% CPU on i7 4800MQ (which is pretty powerful). This is of course a pretty extreme scenario.

DISCLAIMER: Use script at your own risk since I cannot guarantee it won’t mangle your track in ways I haven’t thought of since it directly modifies the XML representing the entire track. Safest to use it on a fresh track.

Cheers,

casrya
casrya is offline   Reply With Quote
Old 08-22-2015, 06:49 AM   #23
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Quote:
587 parameters and with four instances being modulated it hit 40% CPU
That's huge !

Thank you for sharing your script, we may use it with moderation :P
X-Raym is offline   Reply With Quote
Old 08-22-2015, 06:53 AM   #24
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

hehe, I don't think that would be a great solution for me, but I am glad someone did it! I seriously hope eventually REAPER has a way to sync plugins and their parameters.

Could they only watch params which are different from the default plugin state? And then after that make params go inactive after a certain period of time?
Jae.Thomas is offline   Reply With Quote
Old 08-22-2015, 09:21 AM   #25
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by X-Raym View Post
@Jason
Nice it woks for you !

The idea behind make it work with selected track is modularity : you can then put the script inside any macros you want so that it works on all tracks (put Select all tracks action first) or more complex selecting tracks actions (based on name, or track color or whatever you want)

A running in backcground version of this would be without any doubt too cpu intensive, even a low rate. Some effects have a lot of parameters, some tracks has a lot of effects and some projects have a lots of tracks.
So i don't plan to make this kind of adaptation.
That said, I encourage anyone who would try a mod. It is the only way to know :P
Hi X-Raym!

I made a little test - it might be possible to make it work in "realtime":

In this test..
  • the topmost Recabinet is the "master fx" (changing a parameter value in this FX "copies" the value to other Recabinet FXs)


Last edited by spk77; 08-22-2015 at 09:39 AM.
spk77 is offline   Reply With Quote
Old 08-22-2015, 09:33 AM   #26
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

A pack of ReaSynths:
spk77 is offline   Reply With Quote
Old 08-22-2015, 09:56 AM   #27
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

This is awesome
I'm sure a lot of people will like it !
Can't wait to test it !
X-Raym is offline   Reply With Quote
Old 08-22-2015, 11:08 AM   #28
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
Default

Quote:
Originally Posted by casrya View Post

One other note, large numbers of parameters can become CPU intensive. For example I tried it on z3ta+ 1.5 which has 587 parameters and with four instances being modulated it hit 40% CPU on i7 4800MQ (which is pretty powerful). This is of course a pretty extreme scenario.

yeah, parsing the chunk is just not efficient for a lot of situations. Great work on the script regardless!

One idea that I've had for this is to monitor an effect for changes (via the chunk I suppose) And then converting those changes to an OSC message. Reascript can send internal OSC messages to the host (I've not investigated this much yet - not sure how it actually works) - The parameters of the plugins that would be controlled by the master would then just need to be mapped to that control message. I think this would be very efficient...

Unfortunately, I have no idea about OSC - I do plan to dig in though.
James HE is offline   Reply With Quote
Old 08-22-2015, 05:23 PM   #29
casrya
Human being with feelings
 
Join Date: Dec 2013
Location: Melbourne, Australia
Posts: 96
Default

Quote:
Originally Posted by James HE View Post
yeah, parsing the chunk is just not efficient for a lot of situations. Great work on the script regardless!

One idea that I've had for this is to monitor an effect for changes (via the chunk I suppose) And then converting those changes to an OSC message. Reascript can send internal OSC messages to the host (I've not investigated this much yet - not sure how it actually works) - The parameters of the plugins that would be controlled by the master would then just need to be mapped to that control message. I think this would be very efficient...

Unfortunately, I have no idea about OSC - I do plan to dig in though.
The CPU usage is caused by the actual parameter modulation so is internal to reaper and is not caused by the script. Therefore parsing is not really the issue since it is only done once when you run the script. That said it looks like parameter modulation is handled inefficiently by Reaper so maybe the OSC solution could work better? I guess it depends on if there is an efficient way to get realtime updates on parameter changes in a script? Something like a PropertyChangeListener in Java.

@spk77
Are those LICEcaps done using my script or did you write something similar in parallel since that is exactly what my script does

EDIT: I am busy for most of the day but will try and post a LICEcap later to show exact usage of my script.

Cheers,

casrya

Last edited by casrya; 08-22-2015 at 05:33 PM.
casrya is offline   Reply With Quote
Old 08-22-2015, 05:50 PM   #30
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@casyra
It seems to be made from mine, no parameter modulation invlved, and it works on multiple tracks :P
X-Raym is offline   Reply With Quote
Old 08-22-2015, 11:02 PM   #31
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Here's the script:
https://stash.reaper.fm/24909/Link%20FX%20parameters.lua

Link FX parameters.lua
  • Lua script by X-Raym, casrya and SPK77 (23-Aug-2015)
  • Terminate the script from Menu -> Actions -> Running script...

Changelog:
  • Updated on 25-Aug-2015
    • more fixes by casrya
  • Updated on 24-Aug-2015
    • fixes by casrya
  • Updated on 23-Aug-2015
    • optimized
    • comments added





I noticed that passing a return value from TrackFX_GetFXName to TrackFX_GetByName doesn't work...

Code:
fx_name_ret, fx_name = reaper.TrackFX_GetFXName(track_id, fx_number, "")
If fx_name is f.ex. VST: GClip (GVST)

... and it's passed to this...
Code:
fx_index = reaper.TrackFX_GetByName(track_id2, fx_name, false)
...it always returns -1



This works:
Code:
fx_index = reaper.TrackFX_GetByName(track_id2, "GClip", false)
(This means that we have to do "unnecessary" looping)

Last edited by spk77; 08-25-2015 at 08:55 AM.
spk77 is offline   Reply With Quote
Old 08-23-2015, 01:26 AM   #32
casrya
Human being with feelings
 
Join Date: Dec 2013
Location: Melbourne, Australia
Posts: 96
Default

Quote:
Originally Posted by X-Raym View Post
@casyra
It seems to be made from mine, no parameter modulation invlved, and it works on multiple tracks :P
Ah yes, I just had a look at spk77’s script and it is a simple and elegant solution that has mine beat so well done!

I am probably going to have to find another reason to write the track chunk now I went to all that effort :P That said my script is still pretty convenient for the use case it was designed for as long as the param counts are not too high since it doesn’t require the script running in the background so I will still use it for my synth racks which are on a single track

Perhaps if Justin or any of the Cockos crew see this they can take a look at the parameter modulation since something strange seems to be going on with the CPU usage at high param counts?

P.S I did a LICEcap but Reaper stash wouldn’t let me upload due to file size limit but you can actually do some pretty wacky stuff beyond straight parameter linking (LFOs etc.) but not sure if there is a practical application of this hehe

Cheers,

casrya
casrya is offline   Reply With Quote
Old 08-23-2015, 02:40 AM   #33
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@spk77
Quote:
I noticed that passing a return value from TrackFX_GetFXName to TrackFX_GetByName doesn't work...
Yeah, that is a bit not very intuitive... =/

Thank you for your script !

I take a look into the code
that's surprising because it doesn't look at all at my script. ^^ I guess realtime running scripts have very different needs !
I even learned a syntax thing.
good work !
X-Raym is offline   Reply With Quote
Old 08-23-2015, 11:08 AM   #34
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

The script in post#31 is now updated:
  • optimized
  • comments added



Quote:
Originally Posted by casrya View Post
Ah yes, I just had a look at spk77’s script and it is a simple and elegant solution that has mine beat so well done!
Thanks! (Don't know how elegant this is, but different, yes )

Quote:
Originally Posted by X-Raym View Post
@spk77

Yeah, that is a bit not very intuitive... =/

Thank you for your script !

I take a look into the code
that's surprising because it doesn't look at all at my script. ^^ I guess realtime running scripts have very different needs !
I even learned a syntax thing.
good work !
Thanks!
Yes, we have to prevent any unnecessary function calls (to keep the CPU usage low):

(TrackFX_SetParam function is called only when a value of a parameter is changed)
spk77 is offline   Reply With Quote
Old 08-23-2015, 11:18 AM   #35
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Sorry there was a bug - had to make another update, please download again.

(TrackFX_GetFXName was at the wrong place)
spk77 is offline   Reply With Quote
Old 08-23-2015, 01:34 PM   #36
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Thanks for the comments, it will be easier the understand this "make change only if parameter change" !
X-Raym is offline   Reply With Quote
Old 08-24-2015, 02:18 AM   #37
casrya
Human being with feelings
 
Join Date: Dec 2013
Location: Melbourne, Australia
Posts: 96
Default

Hi spk77,

After some more testing I discovered your script had problems with the drop down boxes and checkboxes in ReaComp (not recognising the changes). I modified the param_changed condition which seems to have fixed the problem and hopefully doesn't cause problems in other plugins/situations! I left a couple of commented console messages in there which I used to debug. There are still some double values coming from some of the dropdowns which I couldn't work out and also when you type a value in the text fields. Doesn't really seem to be a problem but you might be able to fix it or come up with a tighter param_changed check.

Cheers,

casrya
Attached Files
File Type: lua Link FX parameters.lua (1.9 KB, 304 views)
casrya is offline   Reply With Quote
Old 08-24-2015, 06:27 AM   #38
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by casrya View Post
Hi spk77,

After some more testing I discovered your script had problems with the drop down boxes and checkboxes in ReaComp (not recognising the changes). I modified the param_changed condition which seems to have fixed the problem and hopefully doesn't cause problems in other plugins/situations! I left a couple of commented console messages in there which I used to debug. There are still some double values coming from some of the dropdowns which I couldn't work out and also when you type a value in the text fields. Doesn't really seem to be a problem but you might be able to fix it or come up with a tighter param_changed check.

Cheers,

casrya
Thanks
Script updated - download from post#31.
spk77 is offline   Reply With Quote
Old 08-24-2015, 10:10 AM   #39
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Hmmm...when changing a parameter value with reaper.TrackFX_SetParam, the parameter becomes "last touched". That seems to mess things up.

I guess we would need something like:
Code:
boolean reaper.TrackFX_SetParam(MediaTrack track, integer fx, integer param, number val, boolean set_as_last_touched)
spk77 is offline   Reply With Quote
Old 08-24-2015, 04:29 PM   #40
casrya
Human being with feelings
 
Join Date: Dec 2013
Location: Melbourne, Australia
Posts: 96
Default

Yes a function like that would be handy and make the code a bit more efficient, and in fact that is why I took the last_fx parameter out of the param_changed check since it doesn’t really matter if the fx changes unless a param number or value changes as well which is checked anyway.

I think I have solved the problem with the duplicates after I noticed that the duplicate values differed only after the 8th decimal place. This is because Lua uses double precision numbers whereas VST params are float. So the solution is to round val to 7 decimal places (float precision).

Updated script attached.

Cheers,

casrya
Attached Files
File Type: lua Link FX parameters.lua (2.1 KB, 367 views)
casrya 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 11:29 PM.


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