Old 11-28-2016, 11:47 PM   #1
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default Item Auto-Gain Staging - Peak vs. RMS / LUFS

Yellow everyone !

A month ago, I asked for help on this forum because I wanted to create a script to do something like this :
  • Normalize selected items to -x dB RMS/LUFS/LU (x and unit specified by user imput) ;
  • If those normalized items have peaks over -y dB (y specified by user), trim them down to peak at -y dB max.

And the amazing X-Raym showed me the way ! Thanks again Man, you're the best

So, before using those scripts (Peak vs. RMS and Peak vs. LUFS), you must be aware of those little details...
  • I'm not a "natural born" coder, just a clumsy "script hacker", so those scripts are a little messy, but they work ;
  • In order to use them, you must have the excellent "spk77_Get max peak val and pos from take_function.lua" script from the no less excellent spk77 in the same folder as my scripts. This fantastic spk77 script can be found in ReaPack ;
  • By default, the target RMS value is set to -18 dB, but you can change it by running the SWS action "SWS: Set RMS analysis/normalize options" ;
  • By default, the target LUFS value is set to -23, but you can change it by running the SWS action "SWS/BR: Global loudness preferences...".

Ok, if you're still here with me, a word about what those scripts do.

When you have a bunch of items selected and you run one of them, you will be asked to specify a "Peak Threshold (dB)" value (default @ -10dB) and an "Under/Over (-/+)" value (default is Over aka "+"). For the purpose of this explanation, let's say that you have kept default values. Selected items will be normalized to RMS or LUFS as specified by the "SWS: Set RMS analysis/normalize options" and "SWS/BR: Global loudness preferences..." respectively, but then if some of those items now have peak over the -10 dB threshold, they are automatically trimmed down to peaks at this -10 dB max. On top of that, note that those items trimmed to -10 are still selected at the end of the script while the others are not anymore.

I hope those scripts can be useful to someone !

Here they are :

https://stash.reaper.fm/v/29005/Nanth...%20Staging.zip

Oh, and by the way, if one of the script guru is kind enough to take a look at those scripts in order to "clean" them, be my guest
Nantho is online now   Reply With Quote
Old 11-29-2016, 04:30 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,901
Default

Quote:
Originally Posted by Nantho
-- Special thanks to X-Raym
Glad you succeeded it with it ! You can be proud of your work

The code is quite ok too me, but if you want criticisms anyway... :P
  • just, one script have "Item" and the other "item" in its name,
  • these functions are a bit cleaner than the exp trick ReaScripts-Templates/X-Raym_Val to dB - dB to Val.lua at master · ReaTeam/ReaScripts-Templates
  • You could have a switch to let us decide if we want this on take volume (as currently) or item gain (maybe more useful when we have only one take per item, as item gain can be easily modified right from the arrange view)
  • You could have pack the spk77 dependency in your zip
But don't worry, it is pretty good already !
X-Raym is offline   Reply With Quote
Old 11-29-2016, 09:04 AM   #3
ericzang
Human being with feelings
 
ericzang's Avatar
 
Join Date: Mar 2014
Location: Phoenix, AZ
Posts: 488
Default

Thanks Nantho and X-Raym! This is helpful to me for initial processing of tracks through a console emulation (nebula).
ericzang is offline   Reply With Quote
Old 11-29-2016, 02:53 PM   #4
Frank B
Human being with feelings
 
Frank B's Avatar
 
Join Date: Nov 2015
Posts: 137
Default

This looks interesting, I normally shoot for -20 LUFS on stereo tracks and -23 LUFS on mono tracks.
I wonder if there is a way to code that into the script as well?
auto-sense mono/stereo and apply the setting.

I barely ever have tracks that after running the actions still peak or go into the red.
When it does i never worry about it as I usually limit the track individually anyway.

I should also add that when it comes to audio tracks I use pan law with +3db preference, this makes my tracks -20 within the stereo field.

-20 LUFS is a round about -18 -16 on the VU meter

I'll give these a try a little later tonight
Thanks
Frank B is offline   Reply With Quote
Old 12-02-2016, 01:24 AM   #5
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

Quote:
Originally Posted by X-Raym View Post
Glad you succeeded it with it ! You can be proud of your work

The code is quite ok too me, but if you want criticisms anyway... :P
  • just, one script have "Item" and the other "item" in its name,
  • these functions are a bit cleaner than the exp trick ReaScripts-Templates/X-Raym_Val to dB - dB to Val.lua at master · ReaTeam/ReaScripts-Templates
  • You could have a switch to let us decide if we want this on take volume (as currently) or item gain (maybe more useful when we have only one take per item, as item gain can be easily modified right from the arrange view)
  • You could have pack the spk77 dependency in your zip
But don't worry, it is pretty good already !

Hi X-Raym !

Thanks for your inputs

I will fix the "item/Item issue" in the next version and I'm definitely gonna take a look at those functions. As for the switch regarding take or item volume, I'm afraid this feature is beyond my "script hacker" skills...

Regarding the integration of spk77 script in my zip, I didn't know if it was ok to do this because I didn't get in touch with him. I was afraid it could annoy him and as I'm a big fan of his work, I certainly don't want to bug him with an unauthorized redistribution of his work. On top of that, pointing potentially users to the fantastic ReaPack seems a good thing to me

Have a nice day !
Nantho is online now   Reply With Quote
Old 01-02-2017, 03:26 AM   #6
scottppf261069
Human being with feelings
 
Join Date: Sep 2016
Posts: 48
Default

hi just seen the auto gain stage zip that i would really like to try. ive tried to instal the zip but it does not recognise the actions. how do i instal it into reaper as an action or what do i do with the zip. cheers look forward to trying it
scottppf261069 is offline   Reply With Quote
Old 01-02-2017, 04:28 AM   #7
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Thanks guys! This looks very useful

Just wanted to ask, how the peaks were being "trimmed" down though?

Envelope automation or a limiter or maybe I've got the wrong idea?
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 01-02-2017, 12:47 PM   #8
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

Quote:
Originally Posted by scottppf261069 View Post
hi just seen the auto gain stage zip that i would really like to try. ive tried to instal the zip but it does not recognise the actions. how do i instal it into reaper as an action or what do i do with the zip. cheers look forward to trying it
Hi !

Well, those scripts work like others, you just need to open the action list, use the "Load" button and hit run

Don't forget that you need SWS extensions and the "spk77_Get max peak val and pos from take_function.lua" script to use them. You can find the links in my first post

Hope it helps !
Nantho is online now   Reply With Quote
Old 01-02-2017, 12:49 PM   #9
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

Quote:
Originally Posted by musicbynumbers View Post
Thanks guys! This looks very useful

Just wanted to ask, how the peaks were being "trimmed" down though?

Envelope automation or a limiter or maybe I've got the wrong idea?
It uses the take volume actually
Nantho is online now   Reply With Quote
Old 01-03-2017, 02:49 AM   #10
scottppf261069
Human being with feelings
 
Join Date: Sep 2016
Posts: 48
Default

sorry about this. ive got both loaded into the actions list and sws extentions , reapack installed. when i try to run the action it says. cannot open file, spk77 file not found does not exsist. i am a true novice at this. 1 i downloaded action. 2 opened zip file. opened reaper and the action list and loaded the actions into the list. run the action on an item and the cannot open file message is shown. if im doing something wrong your input would help me in the future and greatly appreciated.
scottppf261069 is offline   Reply With Quote
Old 01-03-2017, 02:52 AM   #11
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Quote:
Originally Posted by Nantho View Post
It uses the take volume actually
Interesting! Thanks, I'll give it a go!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 01-03-2017, 03:21 AM   #12
ericzang
Human being with feelings
 
ericzang's Avatar
 
Join Date: Mar 2014
Location: Phoenix, AZ
Posts: 488
Default

Quote:
Originally Posted by scottppf261069 View Post
spk77 file not found does not exsist.
Are the Nantho scripts and spk77_Get max peak val and pos from take_function.lua in the same folder?
ericzang is offline   Reply With Quote
Old 01-03-2017, 04:08 AM   #13
scottppf261069
Human being with feelings
 
Join Date: Sep 2016
Posts: 48
Default

ive tried putting both scripts and the spk77 in a folder in the scripts resorce path. and tried. im not really sure what im doing as this is first time ive tried or used such things. tried alsorts. any chance of step by step instructions from the download. its got me stumped and wont rest until i sort it ha ha . would be much appreciated. thanks and have a great new year.
scottppf261069 is offline   Reply With Quote
Old 01-03-2017, 04:35 AM   #14
scottppf261069
Human being with feelings
 
Join Date: Sep 2016
Posts: 48
Default

ive done it not sure how but its working. will have a mess with it. thanks for your time. cheers
scottppf261069 is offline   Reply With Quote
Old 01-03-2017, 04:41 AM   #15
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

Glad to know that it's finally working ! Hope you'll enjoy it

Happy new year Folks !
Nantho is online now   Reply With Quote
Old 01-03-2017, 07:34 AM   #16
SmajjL
Human being with feelings
 
Join Date: Nov 2013
Posts: 2,818
Default

mpl have made a, close media explorer after adding item.
So, can this script be run automatic every time we add an item from ME also?
__________________

SmajjL is offline   Reply With Quote
Old 01-04-2017, 12:21 AM   #17
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

Oh Man, I really don't know about that...

As I was saying in the first post, I'm not a "natural born" coder, just a clumsy "script hacker".

Sorry...
Nantho is online now   Reply With Quote
Old 01-04-2017, 07:25 AM   #18
SmajjL
Human being with feelings
 
Join Date: Nov 2013
Posts: 2,818
Default

That means you are 10.735% more skilled than me.
I tryed opening up mpl_Open and Close Media Explorer when item is inserted and just replaced an action code to run another action code, safe to say I suck with no potential of improvement.
__________________

SmajjL is offline   Reply With Quote
Old 02-11-2017, 07:35 AM   #19
Frank B
Human being with feelings
 
Frank B's Avatar
 
Join Date: Nov 2015
Posts: 137
Default

Can someone please add these scripts to ReaPack?
This would solve the issue of having scripts in proper folders etc.

I added these scripts to the script>x-ray>function folder to get them to work proper.
if anyone has difficulty finding the spk_77 scripts

Thanks

Last edited by Frank B; 02-11-2017 at 08:17 AM.
Frank B is offline   Reply With Quote
Old 07-10-2020, 09:14 AM   #20
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Hey Nice script that you have here.

I've made a little test, and so it seems to work best when we use a 4,5 pan law (levels are spot on with this calibration).

Would it be something possible to have it to work with a 0dB pan law ?
Loulou92 is offline   Reply With Quote
Old 07-10-2020, 09:28 AM   #21
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Well no actually it's something a bit more weird that happens.

If you enter false in the "popup = false -- true/false: display a pop up box" string in the script (my understanding is that this allow the script to process audio without the window showing up), then it applies a different correction than what it applies when you put a "true" argument in the script string above. The correction seems correct with a 0dB pan law when the window pops up, and it is correct with a -4.5 dB law when you edit the script to not show the window.

Is this possible ? Or maybe a user error ?

Thanks !!
Loulou92 is offline   Reply With Quote
Old 07-14-2020, 02:58 AM   #22
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

Hello Loulou92,

Well I honestly don't know what is happening there and as I was saying in the first post, I'm not a "natural born" coder, just a clumsy "script hacker", so I'm afraid I can't help you on this one.

I mainly use those scripts on mono items so I never had this kind of issue...
Nantho is online now   Reply With Quote
Old 07-22-2020, 09:11 AM   #23
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Hey ! Thx for responding, I'm seeing this only now.

Well it's fine as it is now to be honest, it's super useful, the workaround is to have the window popup each time, but actually if you set a suitable default value beforehand, it just adds one "enter" keystroke.

Thank you for sharing it with us !
Loulou92 is offline   Reply With Quote
Old 07-23-2020, 05:37 AM   #24
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 217
Default

You're welcome
Nantho is online now   Reply With Quote
Old 09-05-2020, 11:15 AM   #25
Chipicui
Human being with feelings
 
Join Date: Nov 2017
Location: Uruguay
Posts: 10
Default

Nantho, just wanted to say big thanks for the script and encourage you to keep improving it, because just as it already is, it’s super useful and works really well.
You say you don’t have high programming skills but, at least for this script they are completely ok.
The best part of it is your specific consideration to the peaks issue.
I’ve had this problem in the past when normalizing to -18 and had to go file by file (destructively) limiting the problematic files to a peak value of -1dB... drums and percussion most of the times, as they usually have the biggest crest factor.
Some little things:
is there a specific reason for your choice of a default value of -10dB, instead of let’s say... -9, -6 or -1?
I ask you this because with a value of -10, many quite dynamic files like percussion, drums, etc, are getting a much lower LUFS value than the rest.
Is it considered sound-wise better to leave a such a big margin to 0dB for peak values?
Aren’t plugins easily able to deal with way more than 13 dB of loudness range?
Please, don’t think that I’m criticizing your choice... is just that I’m trying to make my mind up around this somewhat confusing and debatable issue.
Another suggestion: could you make a popup with a list of tracks or items that have crossed the threshold?
Sometimes in Reaper (depending on theme) I find that selected items are somewhat not too easy to spot.
So I was thinking that maybe a popup, with the list ready to be copied to clipboard.
Thanks a lot for your time, really appreciated!!
Chipicui is offline   Reply With Quote
Old 12-03-2020, 02:13 AM   #26
poulhoi
Human being with feelings
 
Join Date: Apr 2020
Posts: 214
Default

Sorry to revive an old thread but I would love to get this script working. In its current state, though, Reaper crashes when I run it. Reaper 6.18, macOS Mojave 10.14.6
poulhoi 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:18 AM.


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