ETM Learn · 04 / 08

Compression: gain that moves

Learn the level rule first, then detector movement, attack and release.

01 · Understand

A compressor changes gain over time according to measured level. Downward compression attenuates the portions that engage it. This can control level differences or shape a sound's onset and sustain. The detector measures level for the gain decision.

locates the active region. For settled hard-knee compression above threshold, 4:1 turns a 4 dB input increase into a 1 dB output increase. A hard knee changes slope abruptly; a soft knee spreads the transition. Attack controls the approach to gain reduction; Release controls recovery. A transient is a rapid change, such as a drum onset, during which processing may not settle.

Terms within reach

Dotted terms offer a definition on hover, keyboard focus or tap. Click to keep it open; Escape or an outside click closes it. All definitions are also available here.

threshold

The level where the active part of a hard-knee compression curve begins. A soft knee spreads the transition over a region around the threshold.

ratio

For settled downward compression, 4:1 means a 4 dB input increase in the active region gives a 1 dB output increase. It does not divide all amplitudes by four.

Attack

How quickly gain reduction approaches its target. The number is not a simple waiting period; its exact definition depends on the processor.

Release

How gain recovers as the demand for attenuation decreases. It affects the envelope and potential distortion.

Lookahead

Audio is delayed relative to detection so gain can respond before the delayed peak reaches the output. This costs latency.

02 · Play & discover

Choose downward compression, peak detection, 4:1 and no auto makeup. Lower threshold on drums. Change attack, then release, while watching gain reduction.

Predict → change one control → compare → explain the result.

Experiment 01

Compare the static curve with motion over time. Auto makeup is an estimate, not guaranteed loudness matching. Judge preference at similar listening levels.

Compressor Bench

idle
Static curve - in ▸ out, dB
Spectrum - dry vs compressed
The loop - dry vs compressed
Gain reduction · 48 kHz analysis model
dry compressed gain reduction threshold
vol
audio starts on first click
Max GR-
Average GR-
Crest change-
Peak change-
RMS change-
Makeup to match-

Experiment 02

The level step separates timing from music. Compare settled target, 10–90% transition and time constant; these are different quantities.

Attack / Release step test - the level jumps up, holds, jumps down

-
Output waveform - the envelope IS the attack and release
Gain applied, dB
input level output gain settled target
Overshoot-
Attack 10→90%-
τ (63%)-
Release 90→10%-
Settled GR-

Experiment 03

Shorten release on a sine. Following individual cycles modulates gain and can add distortion. The displayed release criterion belongs to this test.

Envelope-ripple distortion - measured, 50 Hz sine at 4:1

-
THD vs release time
The gain envelope, riding the waveform
THD-
Gain ripple-
Test criterion ≥-

Experiment 04

Blend dry and compressed. Even without makeup, time-varying gain can change envelope and crest factor. No mix percentage is best for every source.

Parallel compression - what the blend actually does

-
Dry, fully compressed, and the blend - with the blended curve inset
dry 100% compressed the blend unity
Peak change-
RMS change-
Crest change-

Experiment 02

Four hits of the same snare, 250 ms apart, at four different levels. Pick what you are trying to do and watch which part of the hit moves. The attack decides what happens to the stick. The release decides what happens to the tail behind it.

Everything here is matched to the same loudest peak, so nothing is just louder.

Four snare hits, four attack and release pairs

-
The four hits, dry against compressed, with the three measurement windows shaded

Attack / release-
Peak spread-
Transient, first 15 ms-
Body, 20 to 80 ms-
Tail, 100 to 160 ms-

Check your understanding

Does 10 ms attack leave the signal untouched for 10 ms?

03 · Go deeper

With a hard knee, Y = X below T and above it, in dB. Gain is . A soft knee connects slopes across a level range; it does not set timing. Other modes change the active side and direction.

A one-pole smoother uses , . One τ completes about 63.2% of a step; 10–90% takes ln(9)τ ≈ 2.197τ. Apply this to the actual smoothed state; branching and decoupled designs combine times differently.

The feedback law G = −k(Y−T), with Y = X+G, gives 1+k in its active region. Feedback compression is not inherently limited to 2:1. delays audio relative to detection, enabling attenuation before the delayed peak. This is pre-attenuation, not oscillatory filter pre-ringing.

The mathematics in words

Static curve above threshold

Y = T + (X−T)/R

X is input level, T threshold and R ratio. Find the dB above threshold, divide by the ratio and add the threshold. With threshold −18, input −6 and ratio 4:1, output is −15 dB. This is a settled hard-knee curve without makeup gain.

Time constant versus transition time

t₁₀–₉₀ = ln(9) · τ ≈ 2.197τ

For a first-order smoother's step response, moving from 10% to 90% takes about 2.197 times the time constant τ. If τ is 10 ms, the transition takes about 21.97 ms. This does not apply to every processor's Attack definition.

Gain change in decibels

G = Y−X

Subtract input level X from output Y. Input −6 and output −15 give G = −9 dB: 9 dB of attenuation. A gain-reduction meter may show the attenuation magnitude as a positive number.

From time to smoothing coefficient

α = exp(−1/(τfs))

τ is the time constant in seconds and fs the sample rate. Multiply them, take the reciprocal, negate it and raise e to that value. In this smoother, α closer to 1 retains more of the past per sample.

Smoothing sample by sample

z[n] = αz[n−1] + (1−α)u[n]

New value z[n] combines α times the previous value with 1−α times current target u[n]. The weights sum to 1. This is a first-order smoother, not a complete description of every compressor.

Feedback law and compression ratio

G = −k(Y−T); Y = X+G

Attenuation depends on how far output Y exceeds threshold T. Substitute gain G into the output equation and solve: in the active region input changes are divided by 1+k. Thus k = 3 gives 4:1 in this static law.

Numerical challenge: try before revealing the solution

01 · Using those settings, how much settled gain reduction occurs at −6 dB input? Enter a positive reduction amount.

Hint

First find Y = T + (X−T)/R; then calculate X−Y.

Solution & assumptions

Y = −18 + 12/4 = −15 dB. Reduction is −6 − (−15) = 9 dB, meaning applied gain G = −9 dB. Soft knee, detector calibration and unsettled timing can change the result in a different setup.

02 · For one isolated first-order smoother with time constant τ = 10 ms, how long does a step take to move from 10% to 90% of its transition?

Hint

The step response is 1−e^(−t/τ). Solve at 0.1 and 0.9 and subtract.

Solution & assumptions

t₁₀ = −τ ln(0.9), t₉₀ = −τ ln(0.1), so Δt = τ ln(9) = 21.9722 ms. This is a result for that state and topology, not a conversion rule for every compressor’s Attack label. For feedback G = −k(Y−T), solving Y = X+G separately gives ratio 1+k, with no intrinsic 2:1 ceiling.

Further reading: FabFilter: dynamics controls