Build with this node

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

Ask Studio

@maruaudio/dsp/modulation/stereo-ring-modulator multiplies each channel of a stereo pair by a carrier and outputs only the product:

outLeft = fround(left × carrierX) // base frequency
outRight = fround(right × carrierY) // base × ratio, offset by a phase

Both carriers come from one f32 master phase of @maru/oscillators-lissajous-duo, so the right lane's integer ratio and phase offset stay phase locked. The carrier is a sine, or a PolyBLEP saw or square. The output is wet only; the caller owns the dry/wet blend.

Parameters

SetterRange the setter enforcesDefault
setStereoRingModulatorFrequency0.1 Hz to stereoRingModulatorMaximumFrequency(rate); NaN → 0.1 Hz220 Hz
setStereoRingModulatorWaveformClamped to 0 to 2, rounded; NaN → 0: sine, saw, squareSine
setStereoRingModulatorRightRatioInteger 1 to 4 (denominator 1); NaN → 11
setStereoRingModulatorPhaseOffset0 to 180 degrees of the right carrier; NaN → 00°

The frequency ceiling is min(2000 Hz, 0.45 × rate / 4), so a four-times right lane stays below 0.45 × the sample rate: 900 Hz at 8 kHz. The init rate is clamped to 8 to 384 kHz, and a non-finite rate uses 48 kHz.

Lifecycle

initStereoRingModulatorNode → setters → stereoRingModulatorNodeTick(state, left, right), reading outLeft and outRight → resetStereoRingModulatorNode, which zeroes the master phase and outputs and keeps the configuration. A frequency change keeps the running phase. Ticks allocate nothing and do no I/O.

When to use it

Sum-and-difference sidebands on a voice or synth, with the right carrier at a multiple of the left one or in phase opposition.

Limits

  • Stereo in, stereo out, one frame per tick; no audio history, tail or delay.
  • Waveform, ratio and phase changes apply on the next sample with no fade; a product with live discrete controls schedules its own transition.
  • Only the carrier fundamental is bounded. The sum and difference sidebands with the input are not oversampled or band-limited.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Frequency frequency

Set base carrier frequency without resetting the running master phase.

floatsetStereoRingModulatorFrequency
Waveform waveform

Direct carrier configuration. Wave changes are intentionally immediate; callers that expose a live discrete control must schedule their own dry/fade transition rather than presenting this setter as click-free automation.

floatsetStereoRingModulatorWaveform
Ratio ratio

Direct right-lane ratio configuration with a fixed denominator of one. Like waveform changes, a live ratio change can alter the next right sample; use a caller-owned dry/fade transition for discrete live edits.

floatsetStereoRingModulatorRightRatio
Degrees degrees

Direct static right-lane phase configuration in degrees. The reset point is the configured offset. A live phase edit changes the next right carrier sample, so a product must transition it at its own dry/fade boundary.

floatsetStereoRingModulatorPhaseOffset

Dependencies

Dependents

Used by