Build with this node

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

Ask Studio

@maruaudio/dsp/voices/peaks translates the Mutable Instruments Peaks MultistageEnvelope with its UInt32 phase, int16 levels and tables. One state is one mono channel: Twin maps the four pots to one ADSR, Split maps pots 1–2 and 3–4 to two AD envelopes. Two states share the controls and take independent gates. Expert modes and other Peaks functions are silent.

Parameters

setPeaksParameter returns false for an unknown index or non-finite value:

IndexCoded behaviorDefault
0 to 3 potsPosition 0 to 1 → left-aligned 12-bit ADC code (floor(p × 4095) << 4, max 65520)Raw 0, 8192, 32768, 32767
4 edit modeRounded, 0 to 3: 0 Twin ADSR, 1 Split AD; 2 and 3 render silence0
5 functionRounded, 0 to 7; only 0 (envelope) renders0
6 manual gate / 7 channel≥ 0.5 on, ORed with the tick's gate / ≥ 0.5 channel 10 / 0
8 gate CVStored as given; the tick reads only its gateHigh argument0

Twin: pot 1 attack, 2 decay, 3 sustain (code >> 1), 4 release. setPeaksPotRaw takes uint16 codes; peaksGateHigh is the 0.7 V threshold; peaksEnvelopeVolts maps the int16 value to 0..8 V.

Lifecycle

initPeaksState(rate, channel) → preparePeaksState reconfigures and resets → set pots and modes (each write reconfigures, keeping a still-valid segment) → tickPeaks(state, gateHigh) once per sample returns value / 32767, or tickPeaksRaw the int16 code → resetPeaksState clears phase, value, gates and the manual gate, and keeps the pots.

When to use it

A Peaks ADSR or dual AD envelope that keeps the original segment timing and curves.

Limits

  • Mono control output, sample tick; the host defines volts per unit.
  • Increments come from the 48 kHz table, scaled by 48000 / rate elsewhere.
  • The pulse-shaper, bouncing-ball and mini-sequencer files in this folder are separate prepared leaves, not part of this export.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Dependencies

None: this node imports no other node.

Dependents

No other node imports this one.

Used by

No plugin with a published composition uses this node yet.