#[non_exhaustive]pub enum Node {
Show 39 variants
Square {
freq: Value,
duty: Value,
},
Triangle {
freq: Value,
},
Sawtooth {
freq: Value,
},
Sine {
freq: Value,
},
Noise {
color: NoiseColor,
},
Fm {
freq: Value,
ratio: f32,
index: Value,
},
Super {
wave: SuperWave,
freq: Value,
voices: u32,
detune_cents: f32,
},
Wavetable {
wave: WavetableKind,
freq: Value,
position: Value,
},
Seq {Show 15 fields
bpm: f32,
tempo_map: Vec<TempoPoint>,
steps_per_beat: u32,
wave: SeqWave,
duty: Value,
fm: FmKnobs,
pluck: PluckKnobs,
piano: PianoKnobs,
kit: KitStyle,
bass: BassKnobs,
sf2: Sf2Knobs,
swing: f32,
humanize: f32,
env: Adsr,
notes: Vec<SeqNote>,
},
Impact {
hardness: f32,
velocity: f32,
},
Dust {
density: f32,
decay: f32,
},
Env {
adsr: Adsr,
},
Tracks {
tracks: Vec<Track>,
master: Vec<Node>,
buses: Vec<Bus>,
},
Mix {
inputs: Vec<Node>,
},
Mul {
inputs: Vec<Node>,
},
Chain {
stages: Vec<Node>,
},
Lowpass {
cutoff: Value,
q: f32,
},
Highpass {
cutoff: Value,
q: f32,
},
Bandpass {
cutoff: Value,
q: f32,
},
Notch {
cutoff: Value,
q: f32,
},
Peak {
cutoff: Value,
q: f32,
gain_db: f32,
},
Lowshelf {
cutoff: Value,
gain_db: f32,
},
Highshelf {
cutoff: Value,
gain_db: f32,
},
Gain {
amount: Value,
},
Bitcrush {
bits: u8,
},
Downsample {
factor: u32,
},
Delay {
secs: f32,
feedback: f32,
},
Reverb {
room: f32,
mix: f32,
},
Modal {
modes: Vec<Mode>,
mix: f32,
},
Drive {
amount: Value,
shape: DriveShape,
aa: Option<bool>,
},
RingMod {
freq: Value,
},
Tremolo {
rate: f32,
depth: f32,
},
Flanger {
rate: f32,
depth: f32,
feedback: f32,
mix: f32,
},
Phaser {
rate: f32,
depth: f32,
feedback: f32,
mix: f32,
},
Chorus {
rate: f32,
depth: f32,
mix: f32,
},
Duck {
trigger: Box<Node>,
amount: f32,
attack: f32,
release: f32,
},
Compress {
threshold: f32,
ratio: f32,
attack: f32,
release: f32,
makeup: f32,
},
Convolve {
decay: f32,
size: f32,
predelay: f32,
damp: f32,
mix: f32,
},
Granular {
grain_ms: f32,
density: f32,
pitch: f32,
spread: f32,
mix: f32,
},
}Expand description
A node in the synthesis graph. Every node evaluates to a mono signal.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Square
Square/pulse wave with variable duty cycle. duty may be a modulator
(e.g. an lfo) for PWM — the classic moving chiptune lead.
Fields
Triangle
Triangle wave.
Sawtooth
Sawtooth wave.
Sine
Sine wave.
Noise
Noise source (percussion / explosion / texture). White by default;
pink is warmer (−3 dB/oct, good for wind/rumble), brown darker still.
Fields
color: NoiseColorSpectral colour of the noise.
Fm
Two-operator FM: a carrier at freq is phase-modulated by an operator
at freq * ratio with modulation index. Bells, e-piano, metallic
basses. Slide index down for a struck/plucked attack.
Fields
Super
Unison “super” oscillator: voices detuned copies of a band-limited
saw/square, summed for a fat, wide lead or pad (the supersaw). Detune is
spread symmetrically across detune_cents.
Fields
Wavetable
Morphing wavetable oscillator: position (0..1) sweeps across an
ordered set of built-in, single-cycle tables (see WavetableKind),
crossfading between adjacent sub-waves — the classic wavetable sweep.
Modulate position (an lfo or env) for the signature moving timbre:
a vocal morph on formant, a brightness swell on harmonics. Tables
are generated deterministically at build time (additive, band-limited to
32 partials — darker sub-waves use fewer), so no table files are needed;
very high pitches at bright positions can fold.
Fields
wave: WavetableKindWhich table set to morph across.
Seq
A note sequencer: plays notes on a tempo grid, each with its own pitch,
length, and a shared per-note ADSR. This is how you write real melodies,
basslines, and drum patterns (rests = gaps between notes).
Fields
tempo_map: Vec<TempoPoint>Tempo changes on the beat grid at exact rational positions,
applied segment-wise (ADR 0002): a note’s start and end convert to
seconds through the segments in f64 and land on frames with halves
rounded away from zero. Empty = the constant-tempo bpm behavior
— the only behavior documents had before this field existed, so
they render byte-identically. The first point must sit at beat 0.
Not supported on the sampler wave (validation rejects it).
pluck: PluckKnobsPlucked-string knobs (wave: "pluck"), flattened onto the node.
piano: PianoKnobsPiano tone knobs (wave: "piano", engine ≥ 3), flattened onto the node.
kit: KitStyleDrum-kit voicing when wave is kit. Omitted ⇒ classic (the
original kit, byte-identical); acoustic/electronic/808 are
alternate synthesized kits.
swing: f32Swing, 0..1: every off-beat grid step is delayed by this fraction
of a step (0 = straight, ~0.55 = classic shuffle). Off-beats are
odd steps, so set steps_per_beat to the swung subdivision.
Impact
Impact exciter: a short excitation burst that models the contact force
of a strike — a single raised-cosine force pulse whose width is set by
hardness (hard = brief, bright click; soft = wider, duller thud),
scaled by velocity. On its own it is a faint tick; its job is to
excite a resonant body — put it before a modal bank (or any
resonant filter) in a chain: chain[ impact, modal ] is a struck
object. The harder the strike, the more high modes it lights up.
Fields
Dust
Sparse stochastic impulses — a Poisson click train. density events per
second fire at random times with random ± amplitude, each decaying over
decay seconds (0 = bare single-sample impulses). The grain generator
behind crackle textures: fire, rain, geiger ticks, sparks, debris. Feed
it through a bandpass/highpass (for tone) or a modal (for pitched
debris). Its randomness draws from the layer’s deterministic stream, so
like noise it is edit-stable within its own mixer layer.
Fields
Env
ADSR amplitude envelope with an sfxr-style punch transient.
Tracks
The mixing console — only valid as the document root. Each track is a
mono graph placed on the stereo stage with its own pan and gain
(sampler tracks keep their native stereo); master is a processor
chain applied to the stereo bus (compressor glue, reverb — the reverb
runs with decorrelated left/right tails). This is how multi-
instrument music gets a real stereo image instead of a mono sum.
Fields
Mix
Sum (layer) all inputs.
Mul
Multiply all inputs (typically source × envelope).
Chain
Serial pipe: stage 0 is a source, each later stage processes the prior output.
Lowpass
Resonant low-pass filter.
Highpass
Resonant high-pass filter.
Bandpass
Band-pass filter.
Notch
Notch (band-reject) filter: removes a narrow band around cutoff (hum /
resonance removal).
Peak
Peaking EQ: boost or cut a band around cutoff by gain_db (surgical
tone shaping — act on the brightness/centroid the analyzer reports).
Fields
Lowshelf
Low shelf: boost/cut everything below cutoff by gain_db (add weight or
thin out lows).
Highshelf
High shelf: boost/cut everything above cutoff by gain_db (air / de-ess).
Gain
Scale the signal by a (possibly modulated) factor.
Bitcrush
Quantize amplitude to bits of resolution for crunch.
Downsample
Sample-rate reduction by an integer factor for lo-fi grit.
Delay
Feedback delay (echo / comb).
Reverb
Schroeder-style reverb.
Modal
Modal resonator bank: a set of damped sinusoidal partials (modes)
excited by the incoming signal — a struck/resonant object’s body.
Bells, glass, metal bars, wood, ceramic, coins, and the resonant ping
of UI/impact sounds, none of which the oscillators can voice cleanly.
Each mode is one 2-pole resonator (a constant-peak-gain bandpass), so a
bank is N parallel resonators — cheap, stable, deterministic. Use it as
a chain stage after an excitation: chain[ impact, modal ]. The
excitation’s brightness lights the modes; the modes’ frequencies and
decays define the timbre. Author modes explicitly — the cookbook’s
struck-bodies guidance (harmonic vs off-harmonic ratios, short vs long
decays) is the map from material to mode list.
Fields
Drive
Waveshaper for saturation / distortion. amount is pre-gain; shape
chooses the curve (warm tanh, aggressive hard clip, or foldback).
Fields
shape: DriveShapeDistortion curve.
aa: Option<bool>Antiderivative anti-aliasing. The waveshaper’s harmonics fold back
as inharmonic alias dirt at the base rate; ADAA suppresses that for
a clean, hi-fi distortion. Honoured only when the document’s
engine is ≥ 1 (so legacy documents stay bit-exact); within an
engine-1 document it is on by default — set false to hear the raw
aliasing curve. Omitted ⇒ follow the engine.
RingMod
Ring modulation: multiply the signal by a sine carrier at freq. Metallic,
clangorous, robotic textures.
Tremolo
Tremolo: per-sample amplitude modulation — the gain swings between
1 - depth and 1 at rate Hz. Unlike a modulated gain (which does
not stream), the gain is a closed-form function of the absolute sample
index, so tremolo streams natively and byte-identically to the offline
render.
Fields
Flanger
Flanger: a very short modulated delay with feedback — the classic jet sweep / metallic whoosh. Stronger and more resonant than chorus.
Fields
Phaser
Phaser: swept all-pass notches — a hollow, swooshing movement for pads, lasers, and sci-fi textures.
Fields
Chorus
Chorus: a short modulated delay mixed with the dry signal for thickening and width.
Duck
Sidechain duck: gain-reduces the chained signal whenever trigger is
loud — the pumping that glues a bass or pad to the kick. The trigger
is rendered silently (it only steers the gain); chain the audible
kick separately in the mix.
Fields
Compress
Dynamic-range compressor: tames peaks above threshold (dBFS) by ratio,
with attack/release ballistics, then applies makeup gain (dB). The
glue behind loud, punchy game audio.
Fields
Convolve
Convolution reverb with a synthesized impulse response — the “put it in
a real space” effect, with zero assets: instead of loading an IR file,
the node generates its own IR deterministically from its parameters
and its structural position in the graph (the same node at the same
graph position always builds the same IR — edit-stable like the
structurally-seeded RNG sources of engine 2 and later). The IR is a
white-noise burst under an exponential
decay envelope reaching −60 dB at decay seconds (RT60-style), capped
at size seconds, darkened over time by a one-pole lowpass whose
cutoff falls per damp, and shifted right by predelay (the gap
between the dry hit and the room’s answer — larger rooms answer later).
Convolution is FFT-based (single-shot, the whole block at once) and
normalized to unit IR energy, so the wet level stays put as decay /
size change. Like reverb, the tail folds into the document: the
output is truncated to the document length rather than extended. mix
crossfades dry/wet (0 = transparent passthrough). This node is
offline only: convolution needs the whole input buffer, so the
streaming renderer refuses it with a named reason (bounce it offline
and keep the streamed graph causal).
Fields
Granular
Granular texture: chops the incoming signal into overlapping
Hann-windowed grains of grain_ms milliseconds at density grains per
second, replays each at pitch (playback ratio — 2 = octave up, 0.5 =
octave down) with deterministic onset/source jitter and detune of depth
spread (drawn from the node’s structurally-seeded stream in a fixed
order, so the texture is stable under edits), sums them (normalized by
the window overlap so loudness tracks the dry signal), and crossfades
with the dry signal per mix. Frozen pads and shimmer from any source
material: chain it after a note or a noise burst and let spread
smear it into a cloud. mix 0 = transparent passthrough. Offline
only — grains read the whole input out of order, so the streaming
renderer refuses it with a named reason (bounce it offline and keep the
streamed graph causal).
Implementations§
Source§impl Node
impl Node
Sourcepub fn is_processor(&self) -> bool
pub fn is_processor(&self) -> bool
True if this node only makes sense as a non-first stage of a chain
(it transforms an incoming signal rather than generating one).
Sourcepub fn children(&self) -> Children<'_> ⓘ
pub fn children(&self) -> Children<'_> ⓘ
Every direct child of this node — the nested graphs of the combinator
variants: mix/mul inputs, chain stages, a tracks’ layers then
its master chain, and a duck’s trigger. The ONE traversal
definition every walker shares, so a new variant can never be silently
skipped the way the hand-written walkers were (the duck-trigger
omissions in the vary and MIDI walkers were exactly that class). The
match is exhaustive on purpose: adding a variant without a children
decision is a compile error, never a silent skip.
Sourcepub fn children_mut(&mut self) -> ChildrenMut<'_> ⓘ
pub fn children_mut(&mut self) -> ChildrenMut<'_> ⓘ
Mutable form of children.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Node
impl JsonSchema for Node
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more