Build with this node

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

Ask Studio

@maruaudio/dsp/dynamics/stereo-linked computes one gain for both channels of a stereo signal from max(|L|, |R|), with NaN and infinities read as 0. The max link keeps a hard-panned event and cannot cancel anti-phase material. It holds two gain controllers: a linked compressor, which runs @maru/dynamics-keyed-compressor on a unit carrier with the linked magnitude as key, and a hysteretic linked gate, which opens at the threshold, closes 3 dB below it and smooths its 0 or 1 state through @maru/dynamics-envelope-follower. The caller multiplies both channels by the returned gain.

const comp = initLinkedCompressor(48000)
const g = linkedCompressorGainTick(comp, left, right)
outL = left * g; outR = right * g

Parameters

SetterRange the code appliesDefaultUnit
setLinkedCompressorParameters(state, threshold, ratio, attack, release)Keyed-compressor clamps: −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
setLinkedCompressorMakeup−24 to +360dB
setLinkedGateParameters(state, threshold, attack, release)Threshold −80 to 0; follower attack 0.0001 to 2 s, release 0.001 to 10 s−40 dB, 0.01 s, 0.1 sdB, s
setLinkedGateHold0 to 0.5, stored as whole samples0s

The compressor's knee is fixed at 6 dB with peak detection and a unity mix.

Lifecycle

initLinkedCompressor or initLinkedGate → setters → linkedCompressorGainTick or linkedGateGainTick per stereo sample → resetLinkedCompressor or resetLinkedGate, which clear history and keep the settings. Gate hold counts down only while the level is below the close threshold; a new open sample retriggers the full count.

When to use it

Compressing or gating a stereo bus without the image shifting when only one side gets loud.

Limits

  • Gain only: no output buffer, dry mix or lookahead. The gate never adds gain.
  • The gate's hysteresis window is the constant LINKED_GATE_HYSTERESIS_DB (3).

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Makeup db makeupDb

Manual post-reduction gain for the unit carrier returned by linkedCompressorGainTick. The default is 0 dB, so existing linked compressor callers retain their exact gain law.

floatsetLinkedCompressorMakeup
Hold seconds holdSeconds

Hold suspends close transitions after the detector falls below the close threshold. A new open sample retriggers the full integer sample count. Zero is the legacy immediate-close behavior.

floatsetLinkedGateHold

Dependencies

Dependents

Used by