Old 01-04-2022, 01:01 PM   #1
Thunderfinger
Human being with feelings
 
Join Date: Jun 2020
Posts: 48
Default Reascript Analyze Loudness

Hello everyone,

Does anyone know a way to analyze an item in reascript to get its LUFS-I and Loudness range as arguments with the new native Reaper loudness features?

In the past, i've used the SWS reaper.NF_AnalyzeTakeLoudness(), but if possible, I would like a way to do it natively.
Thunderfinger is offline   Reply With Quote
Old 01-06-2022, 07:26 PM   #2
mrmong
Human being with feelings
 
Join Date: Oct 2021
Posts: 34
Default

*EDIT thanks X-Raym for the correction

these are the ones i found within the reascript documentation , seems like only the non native are shown in the documentation unless its named differently or smth will dig around!
NF_AnalyzeMediaItemPeakAndRMS
NF_AnalyzeTakeLoudness
NF_AnalyzeTakeLoudness2
NF_AnalyzeTakeLoudness_IntegratedOnly

Last edited by mrmong; 01-06-2022 at 11:45 PM.
mrmong is offline   Reply With Quote
Old 01-06-2022, 07:41 PM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

NF functions are not native.


Check reaper changelog to see the name of the new functions.
X-Raym is offline   Reply With Quote
Old 01-07-2022, 06:11 AM   #4
Thunderfinger
Human being with feelings
 
Join Date: Jun 2020
Posts: 48
Default

Thanks for the answers!

I was asking this because I saw the new CalculateNormalization() function in in the recent Reaper pre-releases, and I was wondering if I had missed a native function to analyze loudness, which would have opened up some possibilities for me. It seems it's not there yet, so i'll just have to wait a bit.
Thunderfinger is offline   Reply With Quote
Old 01-07-2022, 07:22 AM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,746
Default

REAPER 6.44 will add this reascript/API function:

Code:
CalculateNormalization(source, normalizeTo, normalizeTarget, normalizeStart, normalizeEnd)

Calculate normalize adjustment for source media.
normalizeTo: 0=LUFS-I, 1=RMS-I, 2=peak, 3=true peak, 4=LUFS-M max, 5=LUFS-S max.
normalizeTarget: dBFS or LUFS value.
normalizeStart, normalizeEnd: time bounds within source media for normalization calculation.
If normalizationStart=0 and normalizationEnd=0, the full duration of the media will be used for the calculation.
schwa is offline   Reply With Quote
Old 01-07-2022, 08:15 AM   #6
Thunderfinger
Human being with feelings
 
Join Date: Jun 2020
Posts: 48
Default

Thanks a lot for the details on this new function Schwa.

From my testing, it seems that the CalculateNormalization() function returns a ratio between the current loudness and the normalizeTarget, is that right? So to apply that normalization to an item, you'd need to convert that ratio to dB and apply it as item gain to an item?

Would it be possible to add a return argument in the function to get the current loudness of the item? It would be very useful in scripts where you would want to match the loudness of some items to a reference file.
Thunderfinger is offline   Reply With Quote
Old 01-07-2022, 08:28 AM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,746
Default

The returned value is directly comparable to the media item take volume (or track volume or any volume). If you set the take volume to the calculated normalization, the item will be normalized. The current playback loudness is the current take volume divided by the calculated normalization. If the current take volume is unity (1.0 = +0 dB), then the current playback loudness is 1 divided by the calculated normalization.
schwa is offline   Reply With Quote
Old 01-07-2022, 08:37 AM   #8
Thunderfinger
Human being with feelings
 
Join Date: Jun 2020
Posts: 48
Default

That's a great addition, it really opens up a ton of loudness batch processing possibilities. Also having it analyze the source file means we don't even need to import the files to be analyzed in a project, which will save a lot of time for large quantities of files. Thanks for taking the time to explain it to me.
Thunderfinger 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 01:45 AM.


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