Build with this node

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

Ask Studio

@maruaudio/dsp/oscillators/z ports DaisySP's ZOscillator, a phase-distortion oscillator in the style of the Casio CZ series. A carrier contour is multiplied by a formant sine whose phase resets twice per carrier cycle; the reset is a discontinuity, band-limited with BLEP residuals at its sub-sample time. Shape bends the carrier contour (below 0.5 it scales a ramp-down, above it offsets the contour sine) and mode picks one of three offset and phase-shift branches (below 0.333, below 0.666, above). State and arithmetic are f32, and the output is one sample late.

Parameters

PathSetterRange as codedDefaultUnit
carrierFrequencysetZOscillatorCarrierFrequencyfrequency / sampleRate clamped to 0..0.25220Hz
formantFrequencysetZOscillatorFormantFrequencySame 0..0.25 normalized clamp550Hz
shapesetZOscillatorShape0 to 1, stored as the pending shape1morph
modesetZOscillatorMode0 to 1, stored as the pending mode0morph
gainsetZOscillatorGain0 to 11linear

Lifecycle

initZOscillatorNode(sampleRate) sets current and pending shape and mode together, so the first tick reads defined values (upstream Init sets only the pending ones). Then setters → zOscillatorNodeTick per sample → resetZOscillatorNode, which clears phases and residuals and adopts the pending shape and mode. prepareZOscillatorNodeSampleRate re-derives both increments from the stored Hz values.

When to use it

A one-oscillator voice with a second, independent formant frequency, where shape and mode are the modulation targets.

Limits

  • Mono sample tick, one sample of latency. The tick does not apply gain; the Graph node multiplies by it.
  • Pending shape and mode become current at the end of every tick; at a discontinuity the tick blends current and pending by the reset time.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Z oscillator carrier frequency zOscillatorCarrierFrequencyfloatsetZOscillatorCarrierFrequency
Z oscillator formant frequency zOscillatorFormantFrequencyfloatsetZOscillatorFormantFrequency
Shape shapefloatsetZOscillatorShape
Mode modefloatsetZOscillatorMode
Gain gainfloatsetZOscillatorGain

Ports

  • Out outoutput · audio · mono

One sample per zOscillatorNodeTick call.

Dependencies

Dependents

No other node imports this one.

Used by

No plugin with a published composition uses this node yet.