Convert song volume to album volume

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

gab
Posts: 328
Joined: Tue Oct 11, 2005 1:20 pm

Post by gab »

Is there a way to save in one of the other custom fields (ie. Custom2 and Custom3). If so, how would you make the change
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Open the script file in a text editor and do a global replace of "song.Custom1" for "song.Custom2". There should be two occurrences.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Volition
Posts: 92
Joined: Sat Jul 08, 2006 4:03 am
Location: Deep South, Mainland Australia.
Contact:

Post by Volition »

I've been thinking about the way album gain calculates the figure.

Using big_berny's description in the first post

Album 1:
Song 1A: +2 dB
Song 1B: -3 dB
Song 1C: -5 dB

Album 1 songs -2db

Album 2:
Song 2A: -1 dB
Song 2B: 0 dB
Song 2C: 1 dB

Album 2 songs -2db
you also mentioned that tracklength has something to do with it.

However, i don't think this is right. In my opinion all songs should have the same figure which is the lowest gain. As that figure is the peak volume reading for the entire album.

E.g.

Album 3
Song3a: +22db ( A song deliberatly with barely audible noise)
Song3b: -1db
Song3c: 0

Old calculation would make all tracks +7db. The first song has skewed the result terribly.

I beleive all album3 songs should equal -1db.
In the examples at the top the Album 1 songs should all be -5db and Album 2 is -1 db. I don't beleive album length affects the result.


I am not proficient in writing the text. However I would like some help to change the script to calculate this the way i would like. That way everyone could in theory choose which script they would like to use.

Regards Vol
Volition
Posts: 92
Joined: Sat Jul 08, 2006 4:03 am
Location: Deep South, Mainland Australia.
Contact:

Post by Volition »

In addition to my previous post. Can I get some help so that the script only affects the songs that are cuurently selected in the Library screen. I'd like this to work both ways. E.g Calculating album gain, restoring old figures & resetting. This may already work? can someone let me know if this is the case or help me to adjust the code.

Vol
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

This script uses the current songlist (which is the list of selected tracks) unless you don't have any selected and then the visible songlist is used (which is the list of all tracks in the main window).

I feel like I'd be stepping on Big Berny's toes if I helped you modify this script without consent. But here's a couple of pointers.

The script calculates "albumVolume.Item( albumId )" and "albumLength.Item( albumId )" by adding on the values from each track in the album, in the "result = 1" section. If you want to use the minimum value then all you need to do is ignore "albumLength.Item( albumId )" and always store the lowest value in "albumVolume.Item( albumId )". Of course you'll also need to ignore "albumLength.Item( albumId )" when setting the Leveling value in the second loop.
Last edited by trixmoto on Mon Jul 10, 2006 3:22 am, edited 1 time in total.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

@trixmoto: You (and all others) can do with my scripts whatever you want! No problem for me! :D

@Volition: My script currently calculates the average gain. And the length is needed so a long song with +2db has more effect on the average than a sort one with -20db. In other words: The script handles the whole album as one piece, calculates it's average and adjusts the gain. AFAIK other gain-adjustment-tools like MP3Gain work the same way.

BTW a very loud intro could distort your results, couldn't it?

Big_Berny
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
onkel_enno
Posts: 2153
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno »

I still agree with Volition.
If an Intro on an Album is much louder than the Rest, then it has to be much louder than the Rest (the band will know why) and should still be louder on Album Level.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Just for the record, I agree too. But if that's what you want, I am happy to help you achieve it! :)

(Thanks Big Berny for being so generous with your code.)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Volition
Posts: 92
Joined: Sat Jul 08, 2006 4:03 am
Location: Deep South, Mainland Australia.
Contact:

Post by Volition »

I'll run your album gain and see what i think of the reults by listening. And see how i go. Thanks for the description.
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

onkel_enno wrote:I still agree with Volition.
If an Intro on an Album is much louder than the Rest, then it has to be much louder than the Rest (the band will know why) and should still be louder on Album Level.
But that's also with my script. All songs get the same gain so that the volume differences don't disappear. The only difference is the way the gain is calculated.

Sorry was at a openair festival last week. :)
Big_Berny
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by MoDementia »

Ah I see.
The gain is added to the already (original ripped) loud intro

MM @ 89% = 48db

original ripped intro = 50db
original track 1 = 40bd
MM gain intro = -2
MM gain track 1 = +8

script gain = +7db???

new intro = 57db
new track 1 = 47db

still a 10db difference
onkel_enno
Posts: 2153
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno »

Big_Berny wrote: But that's also with my script. All songs get the same gain so that the volume differences don't disappear. The only difference is the way the gain is calculated.
Ah, cool. Didn't thought so far?
Big_Berny wrote: Sorry was at a openair festival last week. :)
Which festival?
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

MoDementia wrote:script gain = +7db???
Probably the intro is much shorter than track 1. That's why the gain of track1 has more influence on album-gain.

@onkel_enno:
War am Nuke-Festival in St. Pölten (Ö). War hammer! Manu Chao, The Kooks, Jan Delay, Adam Green, The Cat Empire (!!!), undundund. :)

Big_Berny
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Volition
Posts: 92
Joined: Sat Jul 08, 2006 4:03 am
Location: Deep South, Mainland Australia.
Contact:

Post by Volition »

I've thought and thought about it. I actually partitioned of 4,7896,345 brain cells in the last couple of weeks, purely for the tasks of volume leveling.

I believe the most accurate way is to use the minimum figure of any one given track in a album.

I have looked at the script. And understand it.

Basically i can scrap the album length loops.
What is the command within the first loop that will hold the minumum level

eg.

albumvolume.Item( albumid) = ??????? albumvolume.item (albumid)

Can someone help me fill in the question marks?

The rest of the script i have got sussed out.


In a sideline, I looked at the script and worked out that Album ratings can be usefully calculated using this album length script.

I have changed the existing volume leveling script to calculate an album rating using the same basis of calculation.

e.g all tracks from same album use average rating for each song

Track01-5:00 minutes-5stars (awesome song)
Track02-0:30 minutes-1stars (One of those crap soundscapes)
Track03-3:00 minutes-3stars (pretty good Song)

Total Ratings=9stars
#songs=3
Total Ratings/#songs=3stars

However using a calculation based on song length.

Total Ratings=Song Rating * Song Length for each song
track01 5:00*5= 1500
track02 0:30*1= 30
track01 3:00*3= 540
Total ratings = 2070
Album Length=8:30 minutes(510seconds)
Total Ratings/Album Length= 4.01 Stars (script Rounds Of to half stars)

i believe the Second calculation is a more accurate representation of the album as a whole.

i have modified the script, will test it tonight then post if anyone interested.

regards
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Reducing the weighting of the shorter songs seems like a clever idea to avoid excessive lowering of an album average.

I have an autoplaylist which gives me short songs (under 1:30) with a rating of 2.5 or higher, of which I then rate most of them down to 2.0 so they get excluded out of scrobbler dj.

You may also want to consider whether or not very long songs (10+ minutes I guess) should be weighted more/less/same as a normal length song, too. I typically downrate long songs too.

Both of my examples I may change my behavior of in the future, when the new scrobbler dj is completed, I should be able to exclude excessively short and long tracks without having to downrate them to keep them out.
Post Reply