No matter your source of audio, unless they have been (already) mastered to be played together chances are that they will sound very much different from one another and usually it has nothing to do with the kind of sound/music we’ll be dealing with. So we will ignore right now that a pieces of Johann Sebastian Bach will be much quieter than some pieces of Aggrotech or Psytrance or whatever (fill your own favorite style of dance music). And it will not matter to us whether it is some work in project set up for its first mastering or some piece that has been already released to the public and thus already mastered and sometimes even remastered and re-remastered. Having some code that will bring your different sound pieces to a similar sound level will matter to you no matter what your sound files are.
Loudness is a very subjective characteristic of a sound. While RMS was been used in the past it has been mostly discarded in relation to perceived loudness. My own plug-in Max-RMS was a way to deal with its major problem (as it uses an arithmetic mean), meaning the RMS of two sound selections will be different if one has longer quiet parts than the other even if the loudest parts are identical. Thus ReplayGain is not an option as it is build around a RMS.
MeldaProduction’s MLoudnessAnalyzer is a EBU R128 and ITU-R BS 1770-3 compliant loudness meter collection. I am especially interested in its true peak meter and the Integrated loudness meter.
True peak meter shows the true peak level. Most digital-to-audio (D/A) interfaces first convert the incoming audio into a higher
sampling rate and then generate the output analog signal fed into the audio monitors. The filtering involved in this conversion can cause
peaks higher than the original peak level.
True peak level simulates this conversion and displays level in this higher sampling rate. The goal is to avoid peaks over 0dB, otherwise
the actual D/A convertor may get overloaded and produce mild clicks or distortion. The usual practice is to use a limiter as the last stage
of your processing chain and set the ceiling to say -0.5dB, which is usually enough to avoid the overload. Note that since each convertor
is different, the true peak level cannot be correctly measured and different software provides different true peak levels.
The true peak is especially important for normalization of sound.
Integrated loudness shows the overall loudness, hence it is affected by the whole track from the beginning of the playback until you
reset it by clicking on the value field. The host may reset it too; it depends on your host.
Please note that the Integrated loudness is NOT the same as an averaged loudness, as it ignores quiet passages. Imagine a track
which is generally quiet but has a few loud sections. The averaged loudness will be less than the Integrated loudness. Its calculation
uses gating to ignore those quiet passages (levels less than 10 LU less than the current ungated level) of the track. Essentially,
Integrated loudness is a measure of the loudest sections of the track.
Unfortunately the MLoudnessAnalyzer - while working in Audacity - can not operate on a multiple selection.
So we have already identified three goals of the Compex Dynamics Processor:
- It must operate on a selection of several audio sections - High Importance
- It must be able to calculate the True Peak - Low Importance as normalizing could be done separately
- It must calculate a loudness similar to the integrated loudness of the MLoudnessAnalyzer plug-in - Very High Importance
Here’s deep link to the latest Recommendation ITU-R BS.1770-4, PDF in English.
True peak and the integrated loudness (I shall borrow the term from MeldaProduction) are the two elements for which target values can be set. Or rather the difference between both values (as measured in LU) as PLR (peak-to-loudness ratio) and the loudness shall be the targets than shall be altered by the user (standards should be defined).
So the Compex Dynamics Processor shall analyze the selected audio. If the actual PLR is higher than the target PLR, compression will be applied, otherwise expansion. The parameters of both compression and expansion (threshold and ratio) will be calculated by the Compex Dynamics Processor.
I am still undecided about Attack and Release (common) but even more about the RMS length and knee size (rarer).
The most difficult task is calculating a compensation for soft knee processing. The reason for doing it is simple enough. It is already almost impossible to accurately calculate a precise ratio so that the outcome will have the targeted PLR (as you’d have to predict the post-processing loudness) but we’ll try that already. Now, a soft knee changes the average compression or expansion so that even a half-way precise ratio will be different at the knee area around the threshold. This will again change the resulting loudness. There’s a guess but maybe Nyquist will might have a hard time doing that. But I’ll try…
So here are the final goals of the Compex Dynamics Processor:
- A control allowing the user to set Target PLR and Target Loudness - High Importance
- A control allowing the user to set Attack and Release - Middle Importance
- A controll allowing the user to set RMS length and Knee Size - Very Low Importance
- Compressing or expanding with soft knee - Very High Importance
- Calculating threshold (something close to loudness) and ratio - Very High Importance
- Adjusting threshold and ratio to compensate for soft-knee processing - Very Low Importance
Next the technical specs…