Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@maruaudio/dsp/dynamics/stereo-compressor adds detector profiles to the linked compressor of @maru/dynamics-stereo-linked. When its detector high-pass is active, each signed channel passes through its own RBJ high-pass (@maru/filters-biquad, Q 0.7071) before the max(|L|, |R|) link. RMS mode averages that one linked peak magnitude over the keyed compressor's fixed 10 ms mean-square window; it is not the larger of two RMS detectors. The knee is a fixed 6 dB and makeup is manual. The tick returns one gain for both channels.

const state = initStereoCompressor(48000)
configureStereoCompressor(state, -20, 3, 0.01, 0.15, STEREO_COMPRESSOR_DETECTOR_RMS, 120, 2)
const g = stereoCompressorGainTick(state, left, right)

Parameters

SetterRange the code appliesDefaultUnit
setStereoCompressorParameters(state, threshold, ratio, attack, release)−80 to 0 dB, 1 to 1000, 0 to 1 s, 0.001 to 10 s−24 dB, 4, 0.01 s, 0.1 sdB, ratio, s
setStereoCompressorDetectorMode≥ 1 RMS, otherwise peakPeakmode
setStereoCompressorDetectorHp20 to 2000; 20 is off20 (off)Hz
setStereoCompressorMakeup−24 to +360dB

configureStereoCompressor sets all of them without touching detector history.

Lifecycle

initStereoCompressor(sampleRate) → setters → stereoCompressorGainTick → resetStereoCompressor, which clears detector and reduction histories and keeps the controls. The high-pass recomputes coefficients only when its cutoff changes. Turning an active high-pass off clears its histories, so a later re-enable does not resume frozen state.

When to use it

Bus compression where low-frequency energy should not drive the gain, or where an averaged level suits the material better than peaks.

Limits

  • Gain only, linked; no lookahead, auto-release, output mix or tail.
  • With the high-pass off and peak mode, the tick is the linked compressor exactly. NaN and infinities are read as 0 before the detector filters.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Mode modefloatsetStereoCompressorDetectorMode
Value value

At 20 Hz the detector high-pass is a true skip. A changed active cutoff recooks both pre-link filter sections once; ticks only run those sections while active.

floatsetStereoCompressorDetectorHp
Makeup db makeupDb

Manual post-reduction carrier gain; 0 dB preserves the linked default.

floatsetStereoCompressorMakeup

Dependencies

Dependents

Used by