Build with this node

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

Ask Studio

@maruaudio/dsp/processors/stem-player plays four aligned stereo stems (vocals, drums, bass, other) from one host-prepared resource on one shared sample-clock cursor, and mixes them to stereo with per-stem gain, mute, solo and balance. It reads between source frames by linear interpolation at the ratio of the 44.1 kHz source to the host rate, and smooths each stem's left and right gain with a 5 ms one-pole. It is a zero-input, stereo-output block Processor.

Parameters

PathAcceptsDefault
player.run, player.loop≥ 0.5 on; running from the end restarts at 0off
player.positionClamped to 0 to 1 of the clip length0
master.gainClamped to 0 to 1, linear1
<stem>.gainClamped to 0 to 1, linear1
<stem>.mute, <stem>.solo≥ 0.5 onoff
<stem>.panClamped to −1 to 1; centre is unity on both sides, an edge silences the opposite side0

<stem> is vocals, drums, bass or other. Solos add: with any solo on, only soloed, unmuted stems sound. A non-finite value or unknown path returns false. Note-on (kind 2) restarts at 0 and runs when velocity > 0; note-off (kind 3) stops.

Lifecycle

createState → prepare → loadResource → setParameter / handleEvent → process → visualize; reset. Prepare accepts a host rate of 8 to 192 kHz, a maximum block of 1 to 128 frames, no input and two outputs. The host binds slot 0 outside realtime as an in-place f32 view: [44100, frames], then for each stem in order its left and then right frames; length 0 clears. Reset stops the transport and restores the defaults above; the resource stays. visualize writes [position 0..1, run] and advances its revision on every call.

When to use it

Playing back the stems of a separated or multitrack song together, so a player can mute, solo, rebalance and seek them without losing alignment.

Limits

  • The header rate must be exactly 44100 and frames an integer 1 to 16,777,215, with length 2 + 8 × frames and every sample finite, or the load is refused.
  • A loop wraps by subtracting the length; a one-shot stops at the end. A stop ramps the stem gains to zero while the cursor holds still.
  • The leaf keeps a reference to the loaded view; it does not copy it.

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