# Improved Loudness Correction With EBU R128

Music mastered at different levels can be a pain when you’re a dj, as well as when listening to music at home. The great differences in loudness levels is in part due to what is sometimes called the “Loudness War”, but sometimes it is just inconsistent between different issuers. As long as you listen to a CD/compilation as it was designed from the issuer, there is no problem, it is when you start mixing tracks from different sources that the volume starts jumping up and down…

I have used ReplayGain to adjust automatically to a target volume level, and it has served me well. It’s not perfect, though, so I read with great interest about efforts to create tools to implement the EBU R128 standard which is supposedly a better technology for achieving basically the same goal. ReplayGain works very well within music with more or less the same sonic spectrum in my experience, but tended to play modern recordings with lots of bass louder than older music like golden age tango music to pick a completely random example. This would even be noticeable between early and late Di Sarli for instance, not that I would play them together in the same tanda, but just to give you an idea. Much better than random jumping up and down, but with room for improvement.

Two projects were announced at approximately the same time, R128gain and libebur128. I did a little testing with libebur128, and the preliminary results are very promising. I now got my music collection basically converted to using R128 in place of ReplayGain. I also compared the gain values generated with ReplayGain and R128, and it verified my impression that typical pop music will be played back at lower volume, relatively, than before, and typical golden age tango material will be played louder.

To tag my main collection, which resides on a Linux box, I used a small bash script to recursively tag all flac files directory by directory:

#!/bin/bash
find . -type d|