Build with this node

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

Ask Studio

@maruaudio/dsp/filters/envelope-filter is a low-pass whose cutoff follows the input level. A peak @maru/dynamics-envelope-follower detects the input before filtering, and its linear value e sweeps the base cutoff by a signed number of octaves, fc = clamp(cutoff·2^(e·amount), 20 Hz, 0.45 × rate). The cutoff drives a low-pass @maru/filters-state-variable. Positive amounts open on louder input; negative amounts close.

const state = initEnvelopeFilterNode(48000)
setEnvelopeFilterEnvelopeAmount(state, 2)
const y = envelopeFilterNodeTick(state, x)

Parameters

SetterRange the setter enforcesDefaultUnit
setEnvelopeFilterCutoff20 Hz to 0.45 × the sample rate400Hz
setEnvelopeFilterResonanceThe SVF Q clamp, 0.025 to 400.7071Q
setEnvelopeFilterEnvelopeAmount−8 to +84octaves at full envelope
setEnvelopeFilterResponse0.0001 to 2; sets the follower attack and release alike0.03s

The follower clamps its release to at least 0.001 s, so the shortest response gives a 0.0001 s attack and a 0.001 s release.

Lifecycle

initEnvelopeFilterNode(sampleRate) → setters → envelopeFilterNodeTick → resetEnvelopeFilterNode. The resonance setter refreshes the SVF coefficients at once. The tick refreshes them only when the derived cutoff changes, so settled input costs one envelope step and one SVF tick. Reset clears the detector and filter histories, restores the base cutoff and keeps the controls. There is no prepare step; create a new state for another rate.

When to use it

An auto-wah or touch-sensitive filter on bass, guitar or a synth line, where playing harder opens or closes the tone.

Limits

  • Mono. A stereo caller creates one state per lane; nothing here links them.
  • The detector receives the magnitude of the input with NaN and infinities replaced by 0; the filter receives the original sample.
  • No cutoff smoothing beyond the follower's own one-pole ballistics.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Cutoff hz cutoffHz

Base cutoff before signed envelope movement.

floatsetEnvelopeFilterCutoff
Resonance resonance

Resonance is the canonical SVF Q range, delegated to its owning setter.

floatsetEnvelopeFilterResonance
Amount octaves amountOctaves

Positive values open with level; negative values close, in octaves.

floatsetEnvelopeFilterEnvelopeAmount
Response seconds responseSeconds

One shared response time drives both detector attack and release.

floatsetEnvelopeFilterResponse

Ports

  • In ininput · audio · mono
  • Out outoutput · audio · mono

One sample per envelopeFilterNodeTick call.

Dependencies

Dependents

Used by