Before you read this tutorial, make sure you fully understand dynamic range compression first as being applied in music production.
This tutorial will demystify one of the confusing features in audio compression: attack and release times. To illustrate this carefully, it needs to be defined first:
Attack time – the time it takes for the compressor to complete the gain reduction (or bring down the level) based on the compression ratio.
For example, if the compression ratio is set to 1:2 and the threshold is set at -20dB, this means that if the input level is -10dB (needs compression because it is above threshold), the output will be -20dB. If the attack time is set to 30ms; this means that when the input is -10dB = it takes 30ms for the compressor to reduce its gain to become -20dB (output of the compressor).
Release time – the time it takes for the compressor to bring up the level to be the same as the input level once it realizes that the input level does not anymore need compression (because it is now below threshold level).
A good example is that the input level now changes from -10dB back again to -40dB (below the -20dB threshold). The compressor realizes that this does not anymore need compression, so it “releases” the signal and apply some gain to bring back to its original level (uncompressed level) which is -40dB.
A picture is worth a thousand of words. I know that beginners find those definitions still confusing and too technical. So for the best explanation and illustration; I will use diagrams. Refer below:
Credits: Iain Fergusson
OK based on the above diagram, it is obvious the following are given:
Threshold= +3dB
Given input level= +9dB
Resulting output level= +6dB
Computing the compression ratio:
Compression ratio= Sample Input level/Sample output level = +9dB/+6dB= 3/2 or 1.5:1
Since the threshold is +3dB; the compressor won’t do anything to the input level as long as it is below +3dB (no compression, input level=output level). However based on the diagram above, the input level changes from 0dB to +9dB; this activates the compressor since +9dB is above the +3dB threshold.
But the compressor cannot compress or reduce the input level “abruptly”; instead it has a transition phase from +9dB to +6dB targeted output level (based on the compression ratio set). This transition phase is called the “attack phase” as indicated in the diagram above. How long this attack phase depends on the compressor “attack time”. You will see the “linear” transition from +9dB until it reaches the +6dB output level.
As long as the input level is +9dB, the output level is +6dB (one way to think of a “compressor” is an automatic volume regulator). However the input level went down from +9dB back to 0dB; the compressor realizes that starting from +3dB all the way down to 0dB does not anymore need compression, so it “releases” the input level.
The compressor also cannot “abruptly” releases the input level immediately back to 0dB.Based on the diagram above; when the input level is 0dB, the compressor output level is still -3dB. But since 0dB does not need anymore need compression; the compressor “releases” then applies gain to be the same with the input level again. This transition phase is called “release phase”, how long this phase depends on the compressor “release time”.
If you are using the compressor effect in your audio recording, mixing and mastering; you can creatively set the following compressor parameters to get the sound you want: threshold, attack time, release time and the compression ratio. These are the basic elements of a compressor. Setting different values of attack time, release time and other parameters can have significant effect on the resulting sound.
How to set the best attack and release times for a compressor?
Every frequency/range needs a different attack and release times treatment. In a multiband compressor, it lets you assign different compressor settings (threshold, compression ratio, attack and release times) for every frequency band or range. For example if your multiband compressor has 3 bands (bass, mid and high frequency range), you can assign 3 compression settings for each of those bands. The only remaining problem is how you will be able to assign a reasonable attack and release times for each compression band. There are certain rules applied by professional audio recording community as to how to set the attack and release times. For example, they use the beats per minute method of the music. In this tutorial, lets attempt to derive a practical formula guide in computing a reasonable attack and release times based on the frequency being compressed. Supposing you are adjusting a bass frequency, for the sake of simple illustration let’s use a square wave.
In the square wave above, you can say that the:
Period= 16ms
Frequency= 1/t = 1/16ms = 62.5 Hz
Maximum level (amplitude) = +10dB
*********
Update: October 1, 2012, Thank you Brun Leiser for the correction on compression ratio formula.
*********
The compressor formula assuming a De-Esser behaviour would be:
For Input Levels > Threshold:
Outputlevel = (Inputlevel – Threshold)/Ratio + Threshold
If you are interested to find out the relationships between the input and output levels based on a given threshold and compression ratio, download this Excel sheet.
For example, this a typical compressor behavior with the following parameters:
Threshold: -25dB
Ratio= 2:1
As you can see, the output level reduces if the input is louder than -25dB. This attenuation in volume is due to compression. But below -25dB, the output level is unchanged (or the same with the input).
Now you have a clear idea about the basic parameters, incorrect adjustment of attack and release times can also result to incorrect compression. Based on the definition defined in the previous section; attack times is : “the time it takes for the compressor to complete the gain reduction based on the compression ratio”. Ideally, based on the square wave audio above, the attack times should be less than 8ms to effectively compressed the wave which has a frequency of 62.5Hz. In addition, the natural release time should also be less than 8ms to bring back to the normal level once the wave does not need compression. You can picture it out below ( the light gray color are the compressed output):
As you can see in the above compressed square wave, you will notice that if the attack and release times are both set less than 8ms, you will get a naturally compressed wave for a frequency of 62.5Hz. Based on the above analysis, you can deduce:
Attack time= 0.5 * (1/f) = where f is the frequency in hertz
Release time has the same formula= 0.5(1/f)
A. Typical attack and release times for bass frequencies/low frequency band: (10Hz to 200Hz)
For the lowest possible frequency:
Attack time= 0.5 (1/10Hz)= 50ms
Release time = 0.5(1/10Hz) = 50ms
For highest possible bass: Attack time and release times= 0.5(1/200Hz) = 2.5ms
Recommendations: In multiband compressor you can tweak the attack and release times for low/bass frequency band starting from 2.5ms up to 50ms. If you put some safety factor of 2 in the above attack and release times. You can have up to 50ms x 2= 100ms for bass. Although in most cases, below are the most popular attack and release time setting for bass compression in mixing:
Attack time: 40ms
Release time: 80ms
In mastering since the bass spectrum consist of a mixdown of several bass instruments,(not just one frequency element such as illustrated in the example above) you can assign a higher attack and release times which is around 5 times.The actual setting depends on the audio material being mixed.
Attack time: 300ms
Release time : 900ms
B. Typical attack and release times for mid frequencies ( 250Hz to 5000Hz)
This is where the vocal and mid range frequencies are found. Vocals are highly transient and requires fast attack and release times. In this type of frequencies, I would like to use a high safety factor such as 10. The release times could not be actually the same with the attack times since these frequencies are the combination of melodies other instruments:
Recommendations:
Attack times= 2 ms to 20 ms
Release times = 20ms to 200ms
In mastering using multiband compressor, the same concept applies:
Attack times: 100ms
Release time: 300ms
C: Typical attack and release times for high frequencies > 8000Hz
This requires very fast attack and release times
Attack/Release times= 0.5* 1/f= 0.5 * 1/8000= 0.1ms
In practical applications such as in mastering you can use:
Attack times: 25ms
Release times: 50ms
Content last updated on October 11, 2012