Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Improving ReplayGain (Read 50109 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Improving ReplayGain

Reply #50
I remembered something last night.

When it stored the absolute loudness of the file (e.g. 92dB), it was called Replay Level.

When it changed to storing the relative gain (e.g. -3dB), it was renamed to Replay Gain.


I'm not about to change the name, so it's staying with relative gains, referenced to making the loudness 83dB through a calibrated system, plus 6dB.

(plus, conceptually, saying the file sounds x dB loud at reference playback level doesn't actually tell you how much to change the gain if the non-parallel equal loudness curves are even taken into account (see my previous post). Whereas saying "shift it x dB to make it the reference playback loudness" can include that factor in the calculation).

Cheers,
David.

Improving ReplayGain

Reply #51
Quote
No, because perceived loudness depends on loudness!

ohhh, you're right...
thanks for the explanations, now I think I understood all there is to understand about replaygain

Quote
If you're listening to a bass heavy track at 60dB, you'll hear much less bass (relatively) than you will at 80dB. This means that increasing the gain on a bass heavy track by 20dB will cause its subjective loudness to be increased more than a 20dB boost to a bass light track.


this frequency dependent sensitivity is handled in the digital domain, so this is not contradictory to avoiding any use of SPL out of replaygain. but then the next point settles it :

Quote
What's more, the perceived loudness increase of that 20dB boost will be different if it's a boost from 40dB to 60dB than if it's a boost from 80dB to 100dB.


okay, if you want to allow for that kind of tuning of the model, you need to make assumption on how the digital signal will be transformed to SPL, so it's natural to express the results in term of SPL  since the computation (may) depend on this assumption.
I'm convinced, it's good that the 83dB SPL number appear in replaygain.

Quote
If the equal loudness curves were parallel lines, then we wouldn't really have to worry about real world sound pressure. They're not, so it's an issue, and it can only be solved if we make some kind of guess (like the floating ATH in the lame encoder), or calibrate the system properly to a real world loudness - which is what I've chosen to do.

Hope this makes sense.


Yes it does, and now I  knowingly agree with the choices made in replaygain 
The fact those curves are not parallel hadnt hit my mind as an issue, and calibration on real world loudness seems the best solution to me.

It felt unnatural at first that algorithms in the digital domain would want to guess what amplification will end up on the signal and how loud I would be listening to my music, but now I see it's not. And further more I realize that the loudness I usually listen to my music is not as much arbitrary as I thought.


Well, now I understood I'm even more for storing the absolute replaygain (à la "92dB").

oh, and if final loudness was used in the psychoacoustic model, the choice of the right SPL reference when computing the gain matters.
the difference in results with reference SPL set to 83 and set to 89 (err, in fact the real other reference is rather 83-6=77 dB SPL, ie the SPL obtained by playing the pink noise on my machine if I've set the amplification to make pop music sound right) is not simply always a difference of 6 dB due to what you explained.

It makes the whole process of replaygain computation+playback a bit more complex if used as a purist.
let's see :
1. you compute the replaygain, choosing as reference the one corresponding to the genre of music it is.
(so that replaygain can make the good assumption on the digital-to-SPL correspondance you'll typically be using at playback)
2. when playing, how do you choose reference ?
if you'll be playing files that were all of the same genre (ie replaygained with same reference), it doesnt really matter as it will just compensate other amp settings.
if you'll be playing different genres of songs,
a. either you want all of them to sound as loud as the others
then you pick one reference (that means either classical music will not be allowed to play loud passages as loud as an audiphile would want, or the pop songs will really be annoyingly loud, depending on which reference you pick)
b. either you want each song to be played with the gain adapted to its kind.
And then, .. , hmm, what to do..
storing relative or absolute replaygain doesnt change the issue.
I guess the 'audiophile' gain was supposed to handle this, but it won't if it really is an album gain.
(or you have to assume all albums of a given genre will be at the same album gain, which may be true for classical music, but not at all for pop songs).

It seems to me the real purist replaygain fanatic will want the file to include the reference used at computation. (or any other way to get the reference to use for the genre of that song)
Else, the user will have to change the setting between songs if he wants to play pop and classical songs in one playlist.
So we should store both replaygain (track and album) and replaygain reference in each file, or did I miss something ?

Improving ReplayGain

Reply #52
Quote
I'm not about to change the name, so it's staying with relative gains, referenced to making the loudness 83dB through a calibrated system, plus 6dB.

hmm, I think it's in fact 83dB SPL,  -6 dB  => 77dB SPL.
(or you mean the system is calibrated, then is added 6dB attenuation.. )
89 db SPL is the average SPL level if you play pop songs on a SMTPE RP200 calibrated system.
If you play the reference pink noise on a system calibrated to be good to the ear for pop CDs, it will sound 6dB quieter than if it was calibrated for wide range dynamics, i.e. 77 dB SPL.


Quote
(plus, conceptually, saying the file sounds x dB loud at reference playback level doesn't actually tell you how much to change the gain if the non-parallel equal loudness curves are even taken into account (see my previous post). Whereas saying "shift it x dB to make it the reference playback loudness" can include that factor in the calculation).


see the 'purist replaygain fanatic' paragraph at the end of my previous post, I think relative or absolute replaygain are all the same insufficient to have a good method for replaying, if assumed-playback-loudness impact the pyschoacoustics computations.
That's because each song will be computed to a reference which varies according to its genre (else you didnt have to make the model depends on the playback loudness in the first place !)
so the relative gain itself will still be broken, ie. not uniform among songs of different genres.

Improving ReplayGain

Reply #53
Quote
so the relative gain itself will still be broken, ie. not uniform among songs of different genres.

that is not exactly right, the relative replaygains can be made uniform across music genres,
but the point is, the problem then is we lost the recommended-for-this-genre replaylevel  of the file.

So listening to mozart after metallica will sound dull.
(and that's not the point of replaygain. Well, it's one of its features, but the point of replaygain is also to make it possible to compensate differences of loudness among CDs of a same genre because of CD marketing policies while still allowing to replay each genre at the right gain compared to other genres.
And in general allow the user to do what he wants

Improving ReplayGain

Reply #54
To sum up my opinion,
I am for storing 3 values instead of 2 :

1. assumed_system_gain == it's a gain compared to SMTPE RP200 calibrated, 83dB SPL, system.
(think of SMTPE RP200 as a home stereo on which the volume has been permanently set to a precise level, chosen by a comity so that movies and classical music play loud and clear, but not too loud either)
this value depends on the genre of the music  (that's a genre-dependant reference)
For instance :
->  +0dB for wide range dynamics genres (classical, movies, ..)
->  -6dB for pop songs (and that's simply because pop songs are already digitally loud,
          so you typically lower your amplifier settings compared to if you were playing classical)

2. replaylevel, in db SPL  == the perceived overall loudness if played on a system with gain=assumed_gain.  It can range from eg. 80 db SPL to 100  or more.

3. album replaylevel  == loudness of the whole album ..

The assumed_system_gain (let's use a more precise name than 'reference gain' if we want to avoid
confusion) might seem uselessly redondant to store in the file.
But it has to be stored if the replay level computation really takes the expected
real world loudness into account and we want to keep the possibility of playing files of different
genres (and different assumed_system_gain) at the same perceived loudness - see my post
with the 'purist replaygain fanatic' example.
[ and if after all the assumed_system_gain is not to impact the psychoacoustics algorithm,
then there's no real need to use SPL numbers at all, the replaylevel is just a
digital domain computation giving a measure of headroom, and would be better expressed in dB FS.
True it's computed with a calibration designed with one correspondance to real world SPL assumed,
but if it's only assumed and fixed, no point in making it appear in the result. ]

Each of those values could also be stored in other forms, but I think this scheme make them all easy to grasp, and really mean what they are.
You can for instance know the intrinseque loudness as

loudness on RP200 system = (replay_level - assumed_system_gain)

storing the real-world SPL obtained on assumed system (83 for classical-tuned system, 77 for pop-tuned) seems a bit less intuitive, as it is good to be able to get total real world SPL (rp-200 calibrated) of a file  by simply adding 2 values.

And I also find relative replaygain less intuitive than sound level, because it's confusing to look at a number which varies inversely to the level of the song..

Technically, that makes a complete change of the replaygain values, but I dont see how it would be better to keep the same tag names if changing the values's meaning or encoding.
In fact, the next-generation tag readers will be as happy both ways,
while using a new set of tags make it possible to support previous-generation tag readers smoothly.
users would have the possibility to add new tags, with possibly more info, and generate compatiblity tags if they want. re-generate them later if they want other replaygain settings, etc..

I find this kind of spec update scheme the most comfortable.

PS :
the assumed_system_gain value might be even easier to grasp if we stored -assumed_system_gain, and called it
genre_shift, as this value is somewhat a measure of the difference between the typical enjoyed loudness of songs of the given genre, and the typical enjoyed loudness of a wide range dynamics reference material (I think I read they used Star Wars movie sound actually)
'genre_shift' would be a bit easier to grasp, but also a bit further from its precise definition.

Improving ReplayGain

Reply #55
I think you've got more time to write that I have to reply!


You don't need a genre or system gain.

The assumed system is calibrated to SMPTE RP 200 a la -=20dB pink noise = 83dB SPL.

The stored values are the gain adjustments to that system needed to make this track (or album) sound 83 dB SPL loud.

Before we store it, we add 6dB to each gain adjustment value, because that's what everyone has chosen to do. (It should have (optionally) been done in the player, but peple have chosen to do it at the tag calculation/writing stage instead - so be it).

Normal players: apply gain change.

Very good players: subtract 6 before applying it

Best players: give the user a slider so they can add or subtract whatever they want. (Discussions on good labelling and 0dB point for slider can be left for another time. I'd suggest 0dB equiv to 83dB or 89dB, with K-20 and K-14 marked too - up/right (depending on position of slider) = louder sound on play back).


As for the discussion you started with yourself about album gain vs audiophile gain vs different things needing to sound a different loudness - I've been there, hence my suggestion for RealLife RG adjustment (see my very first post in this thread).

Cheers,
David.

Improving ReplayGain

Reply #56
Quote
I think you've got more time to write that I have to reply!

eh eh

Quote
You don't need a genre or system gain.

well, personnally, I do
It really is the same thing as the "real life" replay gain you mention, whatever name we call it.
And to me replaygain is half useful without such a thing.

Quote
Before we store it, we add 6dB to each gain adjustment value, because that's what everyone has chosen to do.


and reading bob Katz, it's not really a surprise. Majoritiy of files come from pop CD which have been recorded with 6dBFS less headroom than the kind of material used for RP200 calibration. So this 6dB is not arbitrary, it's characteristic of a genre. Choosing a 'genre-shift' for each song on audio-engineer concerns has the same goal as knowing its real-life RG value - except you can have a try at it yourself.
That's why I suggested some kind of genre_shift tag. It could introduce RealLifeG in the files and at the same time solve the problem of both 83 / 89 distinct references in use around.

It seems you want to stick as much as possible to the original replaygain tag specs, and I was not planning on arguing to death for storing a precise set of value with a precise set of names, and introducing a "RealLifeRG" tag is just as good to me.

Quote
As for the discussion you started with yourself about album gain vs audiophile gain vs different things needing to sound a different loudness - I've been there, hence my suggestion for RealLife RG adjustment (see my very first post in this thread).


well yeah, and I'm all for that tag. But you don't suggest much about it.
Do you suggest it be restricted to real SPL measure data during real-life event ?
or possibly personnal estimation of appropriate Real life SPL would go there too ?
do you have something in mind so that it's still possible to tell  the latter from the former ?

I'm thinking, if I store  89dB there when replaygain-computing my pop-songs, 83 for classical and maybe 93 for real heavy genres, I would still distinguish it from measured values like 83.46673 with a very, very good chance, and I could use some degree of 'reallife RG' feature now and for most my files, while I dont yet own a recording with reallife RG measures.
(that's the 'genre_shift' aspect of the tag I was debating about. probably more commonly useful than than its other, stricter-sense, aspect of real-recording-calibration-data tag)

Improving ReplayGain

Reply #57
Well, I think the genre dependent adjustment could be a nice extra for some users, but it doesn't have to be part of ReplayGain at all, all that is needed is for the decoding software to check for a genre tag and then adjust according to the user's preference for that genre. This way it would instantly work with all existent ReplayGained files.

Improving ReplayGain

Reply #58
There should be an option to turn the equal loudness contour when making calculation.  It's useful for determining how loud an album sounds, but it tends to make ReplayGain unreliable for reporting how much headroom the material on a certain disc has.  Two songs with similar arrangements at the same RMS can have very different ReplayGain values depending on their frequency response.

Improving ReplayGain

Reply #59
I'd still like to see a plugin that would read the album peak value and use it to prevent clipping during playback !
Don't laugh, it doesn't exists ! We have the choice between applying replaygain, or let the files clip...
How do you burn audio CDs from lossy files ? RG or clipping ? Personally, I apply a -2 db volume correction, which removes 90 % of the clippings, because I'm too lazy to compute how much db is the album peak value.

Improving ReplayGain

Reply #60
For CDs from lossy files in fb2k, you can clean your DSP to just Advanced Limiter (and resampler if necessary), and then burn with the CD Writer component with ReplayGain and the DSP enabled. Voila: CDs with RG leveling and limiter clip elimination.  That's what I do, at least.  Or is this not what you meant, Pio2001?

Improving ReplayGain

Reply #61
Quote
Quote
I think you've got more time to write that I have to reply!

eh eh

Quote
You don't need a genre or system gain.

well, personnally, I do
It really is the same thing as the "real life" replay gain you mention, whatever name we call it.
And to me replaygain is half useful without such a thing.

Quote
Before we store it, we add 6dB to each gain adjustment value, because that's what everyone has chosen to do.


and reading bob Katz, it's not really a surprise. Majoritiy of files come from pop CD which have been recorded with 6dBFS less headroom than the kind of material used for RP200 calibration. So this 6dB is not arbitrary, it's characteristic of a genre. Choosing a 'genre-shift' for each song on audio-engineer concerns has the same goal as knowing its real-life RG value - except you can have a try at it yourself.
That's why I suggested some kind of genre_shift tag. It could introduce RealLifeG in the files and at the same time solve the problem of both 83 / 89 distinct references in use around.

It seems you want to stick as much as possible to the original replaygain tag specs, and I was not planning on arguing to death for storing a precise set of value with a precise set of names, and introducing a "RealLifeRG" tag is just as good to me.

Quote
As for the discussion you started with yourself about album gain vs audiophile gain vs different things needing to sound a different loudness - I've been there, hence my suggestion for RealLife RG adjustment (see my very first post in this thread).


well yeah, and I'm all for that tag. But you don't suggest much about it.
Do you suggest it be restricted to real SPL measure data during real-life event ?
or possibly personnal estimation of appropriate Real life SPL would go there too ?
do you have something in mind so that it's still possible to tell  the latter from the former ?

I'm thinking, if I store  89dB there when replaygain-computing my pop-songs, 83 for classical and maybe 93 for real heavy genres, I would still distinguish it from measured values like 83.46673 with a very, very good chance, and I could use some degree of 'reallife RG' feature now and for most my files, while I dont yet own a recording with reallife RG measures.
(that's the 'genre_shift' aspect of the tag I was debating about. probably more commonly useful than than its other, stricter-sense, aspect of real-recording-calibration-data tag)
[a href="index.php?act=findpost&pid=171081"][{POST_SNAPBACK}][/a]



Using merely genres to set playback mode sounds messy, then atleast something like a K-factor metatag you set: "K-20"/"K-n..."

RealLife SPL is a nice idea, but not so easy to do.

I still want you to send me material we discussed long ago 2Bdecided, altho you haven't.

Improving ReplayGain

Reply #62
Quote
For CDs from lossy files in fb2k, you can clean your DSP to just Advanced Limiter (and resampler if necessary), and then burn with the CD Writer component with ReplayGain and the DSP enabled. Voila: CDs with RG leveling and limiter clip elimination.  That's what I do, at least.  Or is this not what you meant, Pio2001?
[a href="index.php?act=findpost&pid=226903"][{POST_SNAPBACK}][/a]


Thanks for answering, but this is not what I need. When I burn a CD, I want it to be as close to the original as possible. I don't want to apply replaygain to it. If I would, there would be no need for the limiter : replaygain features the needed option to prevent decoding clipping.

Improving ReplayGain

Reply #63
If it hasn't been brought up yet, I would like to add my one feature request. MP3Gain gives you the option of setting the volume at the "max no-clipping" level, on a per track or per album basis.

I could really benefit from being able to do the same thing with FLAC or Vorbis files. Maybe I can do that already and just don't know it. Perhaps with the album_peak info.
flac > schiit modi > schiit magni > hd650

Improving ReplayGain

Reply #64
only thing i have to get off my chest about replaygain is the fact that the mp3's are very soft when burned to cd... i have to normalise with nero to make it a decent volume.. most bars or disco's won't even play replaygained tracks/mp3 burnt to audiocd since they are way off compared to original cd's.. this makes it extremely hard for the dj to determine the correct volume, and generally causes major strain on the equipment used..

any thoughts on this?
[..:: West Coast Electro Sound of Holland ::..]

Improving ReplayGain

Reply #65
Quote
only thing i have to get off my chest about replaygain is the fact that the mp3's are very soft when burned to cd...

any thoughts on this?


http://replaygain.hydrogenaudio.org//faq_quiet.html

Extremely hard for the DJ to determine the correct volume?  Major strain on equipment?  From what is usually at most a -12 db adjustment?  Does his equipment not have a volume control?

Improving ReplayGain

Reply #66
Quote
I'd still like to see a plugin that would read the album peak value and use it to prevent clipping during playback !
Don't laugh, it doesn't exists ! We have the choice between applying replaygain, or let the files clip... [a href="index.php?act=findpost&pid=226899"][{POST_SNAPBACK}][/a]


The MusePack plug-in for Winamp gave this functionality (for mpcs only, obviously!) two years ago.

I don't know why it's not in foobar. Maybe the foobar forum is the right place to ask?

Cheers,
David.

Improving ReplayGain

Reply #67
Quote
I still want you to send me material we discussed long ago 2Bdecided, altho you haven't.
[a href="index.php?act=findpost&pid=226909"][{POST_SNAPBACK}][/a]


I couldn't find most of it - I'll forward what I do have.

EDIT: I couldn't find _any_ of it! I believe Glen (mp3gain) had a copy of the revised implementation which someone came up with. If I could search my email more efficiently I might be able to find the persons address. I know it was based on windowing and 50% overlap before FFT, with some optimisations which meant overall there was still a speed increase. IIRC there were no other changes to the algorithm.

Cheers,
David.

Improving ReplayGain

Reply #68
Quote
There should be an option to turn the equal loudness contour when making calculation.  It's useful for determining how loud an album sounds[a href="index.php?act=findpost&pid=226854"][{POST_SNAPBACK}][/a]


Yes, because that's what it's for!!!

Quote
... but it tends to make ReplayGain unreliable for reporting how much headroom the material on a certain disc has.


The peak sample value tells you _exactly_ how much headroom the material has - usually none!

Quote
Two songs with similar arrangements at the same RMS can have very different ReplayGain values depending on their frequency response.


Yes, because they'll souind different!

If you want a pure RMS measurement, then measure the RMS. It's got little to do with judging or matching loudness, so it's not part of ReplayGain. Sorry!

Cheers,
David.

Improving ReplayGain

Reply #69
Quote
only thing i have to get off my chest about replaygain is the fact that the mp3's are very soft when burned to cd... i have to normalise with nero to make it a decent volume.. [a href="index.php?act=findpost&pid=226991"][{POST_SNAPBACK}][/a]


This is, in an indirect way, the purpose of replaygain : burning the CD softer. Volume adjustments on CD can only be performed downwards, not upwards (look at the link provided by 2BDecided). Normalizing the CD before burning is almost always the same thing (exept with rare weirdly mastered CDs, like old Depeche Mode reissues in 1985) as eliminating the replaygain adjustment !

Improving ReplayGain

Reply #70
Quote
Quote
I'd still like to see a plugin that would read the album peak value and use it to prevent clipping during playback !
Don't laugh, it doesn't exists ! We have the choice between applying replaygain, or let the files clip... [{POST_SNAPBACK}][/a]


The MusePack plug-in for Winamp gave this functionality (for mpcs only, obviously!) two years ago.

I don't know why it's not in foobar. Maybe the foobar forum is the right place to ask?

Cheers,
David.
[a href="index.php?act=findpost&pid=227165"][{POST_SNAPBACK}][/a]

[a href="http://foobar2000.org/temp/replaygain_peak.png]click me[/url]
Microsoft Windows: We can't script here, this is bat country.

Improving ReplayGain

Reply #71
I don't think that is the same as what he is asking for. That scales down a track that still clips after applying replaygain.

Isn't he asking about just keeping the output from clipping, without applying replaygain?
flac > schiit modi > schiit magni > hd650

Improving ReplayGain

Reply #72
This can be done by raising the Pre-Amp.
"To understand me, you'll have to swallow a world." Or maybe your words.

Improving ReplayGain

Reply #73
Quote
This can be done by raising the Pre-Amp.
[a href="index.php?act=findpost&pid=227320"][{POST_SNAPBACK}][/a]

How does raising the pre-amp scale down the global volume of a track to keep it from clipping? I'm serious. I really don't know.
flac > schiit modi > schiit magni > hd650

Improving ReplayGain

Reply #74
Quote
Quote
click me
[{POST_SNAPBACK}][/a]


I don't think that is the same as what he is asking for. That scales down a track that still clips after applying replaygain.

Isn't he asking about just keeping the output from clipping, without applying replaygain?
[a href="index.php?act=findpost&pid=227317"][{POST_SNAPBACK}][/a]


That's right, in your picture, the replaygain mode is "use album gain". However, if the mode is "disabled", when the box is checked, I still get clip warnings.

Quote
This can be done by raising the Pre-Amp.
[a href="index.php?act=findpost&pid=227320"][{POST_SNAPBACK}][/a]


You mean lowering the preamp ? Yes it can. I just have to right click the file, ask its properties, check the album peak, open the Windows calculator in scientific mode, convert the peak value in decibels, and set the preamp to the resulting value.
What I was suggesting is that Foobar would do it by itself  More details in the Foobar2000 forum : [a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=20209&view=findpost&p=227318]http://www.hydrogenaudio.org/forums/index....ndpost&p=227318[/url] , where we can, as 2BDecided suggested, go on with this topic.