#[non_exhaustive]pub enum Node {
Show 35 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,
},
Seq {Show 14 fields
bpm: f32,
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>,
},
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,
},
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,
},
}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
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
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 lists
frequency/decay tables for common materials to copy and tune.
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.
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.
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