Skip to content

Dynamics Controls ​

Dynamics controls decide how much movement the master keeps. In the demo they drive the compressor stage and the Quick Master Dynamics macro.

This is one topic, not five separate decisions. Threshold, ratio, attack, release, and knee only make sense together.

Tune the five together, with your ears

Changing one control shifts what the others do, so judge the result, not each knob in isolation. Always check it against a loudness-matched A/B Comparison: compression that only sounds "better" because it got louder is not actually better.

Threshold, Ratio, Attack, Release, Knee ​

A compressor watches the level of the signal and turns it down while that level is above a chosen point. Five controls describe how:

  • Threshold is the level (in dBFS) where compression starts. Below it the compressor does nothing.
  • Ratio sets how much a level above the threshold is allowed to rise. At 4:1, every 4 dB the input goes over the threshold comes out as only 1 dB over.
  • Attack is how quickly the gain comes down once the level crosses the threshold; release is how quickly it recovers once the level falls back. Each time is one time constant: the gain covers about 63% of its move toward the target in the set time, not all of it.
  • Knee decides whether compression begins abruptly at the threshold (hard knee) or eases in over a few dB around it (soft knee).

The amount the compressor is turning the signal down at any moment is the gain reduction (GR), in dB. Because compression only ever lowers the level, a compressor usually adds a fixed makeup gain afterwards to bring the average back up.

The figure below follows the gain reduction through one loud passage, with one time constant marked after each edge.

Attack and release as time constants
input (dBFS)−10−20−30threshold −20 dBFS gain reduction (dB)0−3−6−9−120100200300400500600time (ms)peak detector, hard knee, 4:1target −9.0 dB 63% at τ = attack30 ms → −5.7 dB 63% back at τ = release100 ms → −3.3 dB
  • input level
  • gain reduction
  • threshold
The input steps from −26 to −8 dBFS and back, against a −20 dBFS threshold at 4:1, so the target is 9 dB of gain reduction, the same as the −8 dBFS row of the table below. With a 30 ms attack the reduction reaches 63% of that target 30 ms after the step; with a 100 ms release it has recovered 63% of the way 100 ms after the level drops. The curve is the compressor's own smoothing run sample by sample, with a peak detector so the detector adds no delay of its own.

With a hard knee and the threshold at −20 dBFS, the static curve works out like this:

Input levelOver thresholdOutput at 2:1 (GR)Output at 4:1 (GR)Output at ∞:1 (GR)
−26 dBFS—−26 (0 dB)−26 (0 dB)−26 (0 dB)
−16 dBFS4 dB−18 (2 dB)−19 (3 dB)−20 (4 dB)
−12 dBFS8 dB−16 (4 dB)−18 (6 dB)−20 (8 dB)
−8 dBFS12 dB−14 (6 dB)−17 (9 dB)−20 (12 dB)

Compressor or limiter?

A limiter is a compressor taken to the extreme: an effectively infinite ratio (the ∞:1 column above), a very fast attack, and usually lookahead so it can act before a peak arrives. Its job is different too. A compressor shapes how the level moves and sounds; a limiter sits last in the chain and only guarantees that peaks never pass a ceiling. In mastering the compressor works gently on the whole track, and the true-peak limiter catches whatever is left.

ControlListen for
ThresholdHow much of the song is being compressed.
RatioHow dense or pinned the loud sections feel.
AttackWhether drums and consonants keep their front edge.
ReleaseWhether the master breathes naturally or pumps.
KneeWhether compression grabs suddenly or eases in.
DYNAMICS · COMPRESSORIDLE
Compression — threshold, ratio, knee, attack, release

The left panel is the transfer curve — input level in, output level out — with the threshold and the soft knee marked; raise the ratio and it bends harder past the threshold. The right panel runs a fixed program (a steady bed with transient hits) through the compressor: the shaded gap is the gain reduction, and attack and release decide how fast it clamps down and lets go. Press play to hear the same program — the pumping you see is the pumping you hear.

Threshold
-18 dB
Ratio
4 :1
Knee
6 dB
Attack
15 ms
Release
160 ms

Practical Workflow ​

  1. Start with a gentle ratio (about 1.5:1 to 2:1 on a full mix) and a soft knee.
  2. Lower threshold until loud sections show controlled reduction, typically 1 to 3 dB of gain reduction on the peaks of a master.
  3. Adjust attack so transients (the short level spikes at the front of drum hits and consonants) are controlled but not flattened. Around 10 to 30 ms lets the front of a hit through; shorter attacks dull it.
  4. Adjust release so the gain returns with the groove, often somewhere between 100 and 300 ms. Too short and the level flutters; too long and the compressor never recovers between hits.
  5. Use loudness-matched A/B before deciding the compression is better.

Parallel compression ​

Compression does not have to be all-or-nothing. Parallel (or "New York") compression blends a heavily compressed copy of the signal under the untouched dry signal. The dry copy keeps the transients and punch; the squashed copy adds body and lifts the quiet detail. A blend control sets how much of the compressed copy is mixed in — at 100% you hear only the compressor, and as you lower it the dry dynamics return.

DYNAMICS · COMPRESSORIDLE
Parallel compression — squash a copy, keep the punch

Blend the dry signal with a compressed copy. The dry path preserves more of the original transients than fully wet compression. This example applies no makeup gain, so blending does not boost quiet passages and output level changes with the mix. Compare the transfer curve and gain envelope, then audition the result.

Threshold
-28 dB
Ratio
8 :1
Blend
50 %

Multiband compression ​

The compressor described above acts on the whole signal at once. libsonare's mastering chain also supports a multiband compressor that splits the signal into frequency bands and compresses each one independently — useful when only one register is misbehaving (a boomy low end, a harsh top) and squashing the whole mix would cost more than it fixes.

Choose the number of bands

The chain supports 2 to 64 bands, each with its own compressor settings; a single band is just the ordinary compressor. See Mastering Chain Config for the fields and Mastering Processors for chain parameters.

How the bands are split, and what each crossover mode does at the cutoffs, is on Crossover Slope and Mode.

Sidechain and Ducking ​

A compressor normally listens to the signal it is turning down. A sidechain lets it listen to a different signal instead: the key. The key only decides when and how far to turn down; it is never heard itself.

The classic use is ducking. A narrator speaks, the music bed under them drops by several dB, and it swells back in the gaps. The voice is the key, the music is the signal being reduced. With a threshold of −24 dBFS and a 4:1 ratio, a voice peaking at −12 dBFS pushes 12 dB over, which asks for 9 dB of reduction on the bed (the same arithmetic as the table above), and the cap rangeDb (18 dB by default) limits how deep the duck can go.

  • Attack decides how fast the bed gets out of the way. Too slow and the first syllable lands on top of loud music.
  • Release decides how fast the bed returns. Too short and the bed surges back in every gap between words, which is audible pumping; a longer release holds the bed down through a whole sentence.
  • Sidechain filter (sidechainHpfEnabled, sidechainHpfHz) high-passes the key so low rumble or plosives do not trigger the duck.

In libsonare:

  • dynamics.sidechainRouter and dynamics.duckingProcessor are the two ducking processors, with thresholdDb, ratio, attackMs, releaseMs and rangeDb. The router also has the key filter above; see Mastering Processors for the full parameter lists.
  • In a mixer scene, an insert names its key strip with sidechainKey. The built-in commentaryDucking scene puts a dynamics.sidechainRouter on music-bed keyed by host; see Mixing Scene JSON.
  • On a live engine, setLaneSidechain(trackId, insertIndex, sourceTrackId) keys one lane insert from another lane (source 0 removes the binding), and setBusSidechain and setMasterSidechain do the same for bus and master inserts. canSetLaneSidechain and its siblings report whether a binding would be accepted, with a reason such as selfKey or cycle. See Mixing Engine for the strips and buses involved.

Play the demo below to hear a voice duck a music bed, and what a short release does to it.

MIXER · SIDECHAIN DUCKIDLE
Ducking: a voice pulls the music bed down

A voice (top) keys dynamics.sidechainRouter on a music bed, as in the commentaryDucking scene. The middle lane is the bed before (grey) and after (teal) the duck; the bottom lane is the gain reduction between them, capped at 18 dB. At the defaults the bed sits about 10 dB down under the voice, but the 100 ms release lets it swell back to about −2 dB in each 150 ms gap between phrases: that swing is the pumping. Raise the release to 500 ms and the bed stays near −11 dB through the sentence, coming back only in the long pause. Press play to hear the mix.

Release
100 ms
Threshold
-30 dB
Ratio
4

In libsonare ​

Studio exposes threshold, ratio, attack, and release directly. Knee is part of the underlying compressor model and preset design, but it is not a first-line control in the browser UI.

Implementation notes

libsonare evaluates a detector level in dB and compares it with the threshold. Stereo detection is linked: one detector level is derived from all channels and the same gain is applied to every channel, so the stereo image does not pull sideways. How that linked level is formed depends on the detector — peak takes the loudest channel at that sample, while the RMS detectors take the mean power across channels, so anti-correlated content does not collapse the detected level.

The hard-knee static curve is conceptually:

text
over_db = input_db - threshold_db
gain_reduction_db = over_db * (1 - 1 / ratio)

Soft knee replaces the abrupt corner around threshold with a quadratic transition. Attack and release then smooth the target reduction into a continuous gain envelope. The detector measures the incoming level in one of three ways:

DetectorWindowBehavior
peakinstantaneousReacts fastest.
rms (default)10 ms running averageCloser to perceived loudness.
logRms50 msDespite the name, a linear RMS average over a longer window: it follows the sustained level and ignores brief transients.

The choice changes how twitchy the compressor is. That detector smoothing is separate from attack/release envelope timing.

Auto-makeup is an open-loop estimate, not a measurement: it is computed once per block from threshold and ratio alone as 0.5 × max(0, -thresholdDb) × (1 - 1/ratio) dB. For a negative threshold and a hard knee, this is half the theoretical reduction at a 0 dBFS detector level; a signal exactly at threshold has no hard-knee reduction to restore. The half factor limits overcompensation for programme material whose level varies over time. Auto-makeup and manual makeup are mutually exclusive — any non-zero makeupGainDb overrides the automatic value rather than adding to it. Final loudness landing is still the responsibility of the loudness optimizer that sits after the compressor in the chain.

Related: Dynamic Range, Crest Factor, A/B Comparison