ReplayGain 2 on Linux: Introducing loudgain

There were never many native Linux tools for replaygaining, so I decided to take over the development of loudgain, a free and open source ReplayGain 2.0 loudness tagger, based on the EBU R128/ITU BS.1770 standard (-18 LUFS). Loudgain uses the well-known mp3gain commandline syntax but will never modify the actual audio data. And it can be used with many file types, currently FLAC, Ogg, MP2, MP3, MP4, M4A, AAC, ALAC, Opus, ASF, WMA, WAV, AIFF, WavPack, and APE.

Loudgain can be installed natively on Linux, is in ArchLinux’ AUR, available for MacOS X via Homebrew and can be used with Windows 10’s Linux bash.

I’d like to mention it here because …

  • many of us (even on Linux) use Mp3tag.
  • my hope is that @Florian picks up loudgain’s "extended" tags (track & album range and reference loudness) in the tag mapping.
  • I appreciate feedback and bug reports on usage of the tags with Mp3tag.

There’s lots of documentation and technical details about loudgain to be found on its GitHub page and also an entry in the Hydrogenaudio Wiki.


This will be a little off-topic and I do not intend to depreciate the work you are trying to do

But the problem with replay gain is that it simply does not work- as different parts of a song have different loudness; different dynamics used. For example you can take any pop-rock song released or re-released somewhere after the year 2000 and you will be able to notice that if the breakdown around 3/4th / 4/5th is over and all of the other instruments come back in a single moment, than from this moment every instrument that was present in the breakdown plus the vocals are now being played much quieter- because in the breakdown everything [that was left in it from the overall instrumentarium of this song] was made louder. [And that is the result of the loudness war]

Or are there now replagain tools that take this into consideration- and different apply different gain values to different parts of a file?

@Zerow: In my eyes, much of the dynamics are lost due to modern "loudness war" over-compression techniques. Just compare any good recording made in the 1980s to a newer remaster (take any good Jazz or maybe Floyd album), I think it can be heard.

The EBU standardises on a relatively low "center level" of -23 LUFS (-18 LUFS to be used with ReplayGain 2, this is defined to approximately the same as the olden "89 dB" setting of the ReplayGain 1 algorithm). The idea behind this is to give a lot of headroom for real dynamics (ex: percussion), without clipping, and still give a psychoacoustic model where every part of a program is experienced at "the same loudness" (i.e., no more fiddling with the volume knob). A "program" as spoken of in EBU documents, can be a single track or sound file as well as a 2-hour set; with ReplayGain, this would typically be a single track and/or album.

And no, there aren’t currently any "overall" ReplayGain tools that would adapt during a program. Loudgain (and other tools) typically measure the integrated loudness of a program (track/album). Sound engineers in production use (or should use) the same algorithms and typically measure short term/momentary LU/LUFS loudness units (as opposed to the VU meters used in earlier times).

Unfortunately, there is still the idea of "the louder the better" in the heads of many, even sound engineers and producers, thus depriving us of much detail that really could be present. I also talk to a lot of musicians and bands—some of which are really not happy to what’s done to their music in production just because of what marketing guys tell their labels about "sellability".

The only way we could experience the real potential of music (again) would be if producers started using their LU meters and make good productions with less compression and a higher dynamic range again. The technology is here.

Here’s a short explanation:

Yes, that was exactly what I had in mind. I shave started noticing this very clearly around 5 years ago

At first I thought than only some of songs in my collection were messed up- but after a couple of months I was absolutely sure that not some but [more or less] almost all

I leave in an Eastern Europe country and full scale loudness war came to us 10 years after initial shoots. [Around 10 years is how far from the so called Western World we are in terms of music: 10 years after mashups hit the music scene we finally had mashup parties in clubs, it tool like 10 years for our music business to start giving to artists Golden Records Awards utilizing modern techniques and interesting constructions etc.]

I do own a degree in the history of popular music, but I think that the loudness war has been started by by Butch Vig in 1991 when he made the decision to make that opening guitar so loud in "Smells Like Teen Spirits". Although back then it still could have been viewed as an artistic expression, an audio gimmick if you will- but what followed in the music industry after that was a race head on to a brick wall. Or to a volume knob, as from that particular song you can make a fun game: of trying to adjust the volume level accordingly to the same level of loudness as the songs goes on

I will not pretend that I understand this fully, but I knew about this 89 dB level since I started using MP3Gain around 2002.

Still? Will there ever be? Would it be possible?

But if the overall public is unaware of the changes and to what they are being exposed to, then why would a software like that be created? Me myself it took many years to notice this on my own and to understand what does it mean, that a sound does not have enough space [my translation of this term to English may not be correct]- that it is flattened. Instead of such software we have Auto-Tune. Yeah, hurray for the progress...

But how the public is suppose to know? I recently went to a doctor to check my hearing on the account of me suspecting misophonia [which I lately became to suspect as hyperacusis]. The first ordinary doctor had no idea what I was talking about [Red Book standards, sound compression, spectrogram] while the sound specialist also was not fully comprehending thus give me more information. Overall they could not perform the kind of tests I hoped for but at least talking with a sound technician performing two sessions of tests gave me some knowledge [that the pubic completely is unaware of what is going on with music, because even these experts in the sound area are unaware of them]

There are some exceptions. For example when being already aware of the problem I re-listened to the discography of Rammstein [minus the latest stuff] I was positively stunned by how relatively mild the differences within a given recording of a song there were. Yes, the dynamics are still "squeezed" but the differences between a verses and chorus are somewhat acceptable to me. On the other hand you have bands like Metallica where you take their last normally sounding album from 1991 and compare it to the ones from the 1996 and 1997. I am talking of course about the original pressing of "The Black Album" and not some remastered a decade or two later "revamp" rendition of it

Another example [and more in accordance to what I will present in a moment also as an example]: the 20th anniversary reissue of the debut album of Apocalyptica from 1996. I feared that it would be destroyed, but surprisingly I practically do not hear the difference and only see it in an audio editor- that they made it minimally louder in comparison to the original release [although I have not analyzed every track second-by-second]. But on the other hand there was that "The First Era 1996-2002" edition release in 2018 of the first four Arcana albums. As a result the three first ones were messed up, with 4th one [the newest one] already having dynamic range destroyed "originally" in 2002

But what is most revolting for me is that even the scores from movies are being destroyed beyond any comprehension: Just 3 examples:

1] "Moonrise Kingdom" OST from the 2012 movie, track 1, "The Young Person's Guide To The Orchestra (Variations And Fugue On A Theme Of Purcell), Opus #34, Themes A-F". This is suppose to educate the viewers / listeners, but at at 2:56 they suddenly and audibly flatten the dynamics- thus distort the lesson. What were they thinking? Was was the point of using such composition when delivered in such distorted form?

2] "Inception" movie score from the 2010. If you take the action driven "Mombasa Chase" track from the bonus 5.1 Blu-ray edition and compare it with the official CD release, you will surely notice the difference. It is something that I have noticed in overall a long time ago: what can be heard in the movie is usually better than was is officially released- as if the producers / executives of the movie itself were better in preserving a natural sound of music than people working in the music business. Ridiculous but true. And what is more: even that movie crew is not without a blame here- just listen to the version from the fan released complete edition from 2016 of that score by the user YourFavorateMusic from the FFShrine forum and then compare the waveforms. So a question arises- are even renowned composers unaware of what is being done to their music? Or do they simply have no control whatsoever over what and how is released under theirs names?

3] And once again Hans Zimmer, that top notch uber talented composer and also a multi-instrumentalist. I watched all the making-ofs of the 2014 "Interstellar" movie. And he said in the segment about its music, that he continuously is looking for new sounds for his works. And indeed the producers took the effort and secured recording in a church of some unique pipe organs, played by some professional musician. And what did the sheet music had written on it, shown in that documentary? A note about a proper appliance of dynamics. And what was the result on the officially released score album? I think you already know; and once again, that YourFavorateMusic person prepared [in 2016] a proper rendition of that score

Often an avid fan of this genre is left with a choice: do I listen to a poorly mastered material from a great movie that lasts only 45 minutes, which was released at the time of the picture premiere in the 1980s - or do I try to enjoy a really clean sound and of twice as much of playtime, which was released by niche company like La-La-Land Records or Varèse Sarabande 30 years later but with awfully destroyed dynamics?

I also noticed that when I am watching a movie from 1970s or 1980s and a song is used in it [in a non diagetic way],that I can clearly hear how the music is suppose to sound. I just like to take extra attention of what I hear then, so that I will have less doubts in the future when listening to a remastered version of any song, that what I hear is plain wrong [an that it is some kind of a loud war driven remastered ersatz]

And I have a friend who is a light case of an audiophile. And he told me recently that in all those specialized shops that he went to, the staff was using CDs from 1980. And that was like the final proof for me that my unfortunate findings are correct

One could expect that in a few years after all that auto-tuning layered on top of total lack of dynamic range in almost every kind of music some producers will start to go the other way. But with even the symphonic scores and neo-classical music being destroyed I just doubt it

Since 2015 I also started to notice clearly the compression in audio files. Nevertheless even in that heavily compressed explanation video the problem is evidently audible to me

But I bet that in 2005, in spite of already being a grown up, a fan of scores and a what you might call a conscious listener that avoided radio playlists and exposure to the music outside own established taste, I would had watch it and commented it "I think I notice the difference - but I do not know what the fuss is about". And I say this on the basis that I used to notice some overall sound differences between versions of song in different mixes, which with time I came to recognize on the account of different codec compression of the files [acquired from different sources]- I was listening and knowing that something was different between the two files but I had no idea what it was or which was better sounding [and I was completely unaware back then of existence of spectrograms]. And also that audiophile friend of mine did not knew why were they using recordings from 1980s- but years later it is without a doubt also for my friend, that there are simply superior in sound to what [in general] modern music business sells to the people

Shame on them

[Maybe my initial response post should be moved to the Off-Topic section, along with our following posts? And be entitled simply "Loudness War?"]

Well it should have been a note that loudgain is available in the first place, but has already been moved into "Off-topic". And now it’s of course totally off-off-topic :rofl:

I wanted this to became off-topic and flagged as such for the staff attention- but I intended this only for my initial answer and for what has followed it. I was suppose to be turned into a new thread entitles "Loundess War", with your initial post being left alone

And now I want to post some more info concerning loudness war- but I see no sense when it will be lost on the account of being hidden in a thread entitled ReplayGain 2 on Linux: Introducing loudgain