Old 09-18-2020, 10:09 AM   #1
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default Destructive normalize

Hi, I always thought that was kind of a hassle when you've just rendered something out and you need to normalize it, but you also want to keep the same name, instead of naming it "my awesome track-normalized.wav" or renaming the old file "my awesome track-unnormalized.wav", dragging it back into your project, and rendering it as my "awesome track.wav", but then of course sending it off, only to realize that when you dragged it back into the project, you forgot to turn off the mastering, and so it got mastered twice.

Now that I know some Reascript, I've made a solution!
https://github.com/bosterho/Reascrip...0normalize.lua

It works the same way as Melodyne. When you make a new render it renames the old un-normalized file to "my awesome track-orig0.wav", incrementing the number if you normalize more than once.

Last edited by Ben Osterhouse; 10-03-2020 at 10:34 PM.
Ben Osterhouse is offline   Reply With Quote
Old 09-18-2020, 03:52 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Does it preserve all metadata chunk ?


Cause that was something I experimented with ffmpeg-normalize etc.
X-Raym is offline   Reply With Quote
Old 09-18-2020, 05:04 PM   #3
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

No it doesn't. I found your script Set selected items sources TagLib metadatas.lua, so I see it's possible to write previous metadata to the newly normalized file.

I was just thinking about ffmpeg for this actually! If you could normalize the audio from a video without having to render the video again that would save a lot of time.
Couldn't you just have the Reascript re-write the metadata after it runs ffmpeg normalization?
Ben Osterhouse is offline   Reply With Quote
Old 09-18-2020, 05:19 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

This TagLib still works but taglib is just id3, not the other chunk,


FFmpeg surprisingly enough doesn't preserve all chunks either,


I end up building up my own "inject all metatdata chunk from one source to another" script, and it works very nicely, I think it is the only solution I found who does it all. I'll surely make a script pack for it.
X-Raym is offline   Reply With Quote
Old 09-18-2020, 05:34 PM   #5
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

Ok interesting. I looked and didn't find any functions for getting the metadata state chunk. Do you have to read it straight from the wav file or something? That would be very difficult I'm sure.
Ben Osterhouse is offline   Reply With Quote
Old 09-19-2020, 01:47 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Yes exactly, I needed to decode wave files chunks to be able to recreate a new file with them.
I spent a lot time on various wav file definition pages... ^^ but now the copy is bit perfect and have extra feature like updating cue markers or even dxChannelMask... all preserving other chunks.
X-Raym is offline   Reply With Quote
Old 09-19-2020, 06:18 AM   #7
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

Very cool!
Ben Osterhouse is offline   Reply With Quote
Old 09-19-2020, 02:14 PM   #8
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

I tried normalizing with ffmpeg, and when I used loudnorm to do a double pass on a longer video, it took almost as long as it would have to just re-render the video in Reaper. O well.

I'm just realizing, you probably had to find all the metadata for all the different formats (mp3, mkv, mp4) too! That's a lot.
Ben Osterhouse is offline   Reply With Quote
Old 09-19-2020, 04:13 PM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@Ben Osterhouse
Oh no, I just care about WAV !
All format... this would be quite hard.
X-Raym is offline   Reply With Quote
Old 10-03-2020, 10:02 PM   #10
Arthur McArthur
Human being with feelings
 
Arthur McArthur's Avatar
 
Join Date: Sep 2016
Location: Toronto
Posts: 744
Default

Awesome stuff, Ben. Any chance of a version that works on the selected item in the media explorer?
Arthur McArthur is offline   Reply With Quote
Old 10-03-2020, 11:26 PM   #11
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

I suppose it would be possible to make an action where it would put files from the media explorer into the current project, do the normalization, then take them back out again, but I'm not sure --Maybe something to try sometime.
Ben Osterhouse is offline   Reply With Quote
Old 10-04-2020, 01:54 PM   #12
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

Ok I tried it, and actually it's totally possible! I put it on my github if you want to give it a try: https://github.com/bosterho/Reascripts
Note that it uses the Ultrashall Api.
Ben Osterhouse is offline   Reply With Quote
Old 10-04-2020, 04:39 PM   #13
Arthur McArthur
Human being with feelings
 
Arthur McArthur's Avatar
 
Join Date: Sep 2016
Location: Toronto
Posts: 744
Default

Thanks Ben for taking a crack at this!

I ran it and am getting an error:

...EAPER\Scripts\Media explorer normalize selected item.lua:44: attempt to index a nil value (local 'filenamebuf')

I wonder if it's because I'm on the recent dev version of REAPER with the Media Explorer changes.
Arthur McArthur is offline   Reply With Quote
Old 10-04-2020, 04:53 PM   #14
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

That's strange --Somehow it's not getting the filename of the item after inserting it. I haven't checked out the development builds yet, but yeah, maybe it would work on a normal build.
Ben Osterhouse is offline   Reply With Quote
Old 10-04-2020, 06:09 PM   #15
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

A simple feature like this probably isn't worth sorting out haha, but still, it does make me wonder... so I got the development build. I'd been meaning to check that out at some point anyways. I still didn't get the error you got. I wonder if it has to do with the operating system --I'm on Windows. I also found it freezes up Reaper if you try to do it to mp3's :P
Ben Osterhouse is offline   Reply With Quote
Old 10-04-2020, 06:31 PM   #16
Arthur McArthur
Human being with feelings
 
Arthur McArthur's Avatar
 
Join Date: Sep 2016
Location: Toronto
Posts: 744
Default

Very bizarre- I'm not getting the error at all now, but the script wasn't working, so I edited the first ultraschall.mediaexplorer_oncommand to action ID

41001 "insert item on new track"

and it works great now! So confused but happy it's working. Thanks so much for this, Ben.
Arthur McArthur is offline   Reply With Quote
Old 10-04-2020, 06:35 PM   #17
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 51
Default

Cool! Yeah that action makes more sense.
Ben Osterhouse 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 07:17 PM.


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