WaxNative API reference

Every wax.* graph node with parameters. For tutorials, see wax-native.html · quick index: node index.

WaxNative & page API

NodeParametersPurpose
WaxNative.create()—Async factory; one wax instance per HTML page
WaxNative.hasBridge()—True when WAX plugin inject is present
WaxNative.keepAlive()—Keep WebView active on Project / hub URLs
WaxNative.emitEvent(name, payload)Event name + JSON payloadHost bridge (param sync, etc.)
wax.render(outL, outR?)Output node(s)Commit graph to engine
wax.didEmit()—Whether last render reached native engine
wax.reemitLast(reason?)Optional debug stringRetry last batch
wax.host.sampleRate() …—Block size, input/output channel counts
wax.midi.ready()—Promise when Web MIDI is available
wax.midi.noteOn(note, vel)MIDI note 0–127, velocity 0–127UI keyboard → midinotein
wax.midi.noteOff(note)MIDI noteRelease UI key
wax.midi.cc(n, value)Controller 1–127, value 0–127Host automation slot feedback
wax.connectMic()— (user gesture)Browser: mic → wax.in; no-op in plugin
wax.resumeAudio()—Unlock suspended AudioContext in browser
WAX._internal.receiveWaxNativeEvent(name, payload)Scope / meter blocks from engine
window.WAX_Play / WAX_Stop / WAX_BPMBPM number for WAX_BPMDAW transport → re-render

Graph nodes from @elemaudio/core@4.0.3 (same in wax-native.js). Props types from Elementary typings.

Host, time, and control

NodeParametersPurpose
wax.in(props, x)props { key?: string; channel?: number;}
x
Host or browser input — FX entry point (`channel` index)
wax.const(props)props { key?: string; value: number;}Control value with stable `key` — knobs, automation, presets
wax.param(props)props { key?: string; index: number;}Host automation slot (`index` 1–32) as graph signal
wax.sr(…)—Sample rate (Hz) as signal for graph math
wax.time(…)—Elapsed time signal for modulation / sequencing

Oscillators and noise

NodeParametersPurpose
wax.cycle(rate)rateSine oscillator — frequency in Hz
wax.saw(rate)rateSawtooth oscillator
wax.square(rate)rateSquare wave oscillator
wax.triangle(rate)rateTriangle wave oscillator
wax.train(rate)ratePulse / clock train at frequency
wax.phasor(rate)rate0→1 ramp phasor at rate
wax.syncphasor(rate, reset)rate
reset
Hard-synced phasor
wax.blepsaw(rate)rateBand-limited saw (cleaner bends)
wax.blepsquare(rate)rateBand-limited square
wax.bleptriangle(rate)rateBand-limited triangle
wax.noise(props)props { key?: string; seed?: number;}White noise source
wax.pinknoise(props)props { key?: string; seed?: number;}Pink noise source

Filters and tone

NodeParametersPurpose
wax.svf(props, fc, q, x)props { key?: string; mode?: string;}
fc
q
x
State-variable filter (LP/HP/BP/notch/allpass modes)
wax.svfshelf(props, fc, q, gainDecibels, x)props { key?: string; mode?: string;}
fc
q
gainDecibels
x
SVF-based shelf EQ
wax.lowpass(fc, q, x)fc
q
x
One-pole lowpass
wax.highpass(fc, q, x)fc
q
x
One-pole highpass
wax.bandpass(fc, q, x)fc
q
x
Bandpass filter
wax.notch(fc, q, x)fc
q
x
Notch filter
wax.allpass(fc, q, x)fc
q
x
Allpass filter
wax.lowshelf(fc, q, gainDecibels, x)fc
q
gainDecibels
x
Low shelf EQ
wax.highshelf(fc, q, gainDecibels, x)fc
q
gainDecibels
x
High shelf EQ
wax.peak(fc, q, gainDecibels, x)fc
q
gainDecibels
x
Peaking EQ band
wax.biquad(b0, b1, b2, a1, a2, x)b0
b1
b2
a1
a2
x
Generic biquad coefficient filter
wax.pole(p, x)p
x
Real pole smoothing
wax.mm1p(props, fc, x)props { key?: string; mode?: string;}
fc
x
Moog-style one-pole
wax.prewarp(fc)fcBilinear prewarp for cutoff
wax.smooth(p, x)p
x
Smooth a control signal
wax.sm(x)xSmooth (alias)
wax.dcblock(x)xRemove DC offset
wax.df11(b0, b1, a1, x)b0
b1
a1
x
First-order delay / filter building block
wax.zero(b0, b1, x)b0
b1
x
Delay / zero-pole helper
wax.pink(x)xPinking filter on white noise

Envelopes and dynamics

NodeParametersPurpose
wax.adsr(attackSec, decaySec, sustain, releaseSec, gate)attackSec
decaySec
sustain
releaseSec
gate
Amplitude envelope from gate/trigger
wax.env(atkPole, relPole, x)atkPole
relPole
x
Simple envelope follower
wax.compress(attackMs, releaseMs, threshold, ratio, sidechain, xn)attackMs
releaseMs
threshold
ratio
sidechain
xn
Dynamics compressor
wax.skcompress(attackMs, releaseMs, threshold, ratio, kneeWidth, sidechain, xn)attackMs
releaseMs
threshold
ratio
kneeWidth
sidechain
xn
Sidechain-aware compressor

Delay, memory, and samples

NodeParametersPurpose
wax.delay(props, len, fb, x)props { key?: string; size: number;}
len
fb
x
Delay line — time in seconds
wax.sdelay(props, x)props { key?: string; size: number;}
x
Sample-based delay
wax.z(x)xSingle-sample delay (unit delay)
wax.tapIn(props)props { key?: string; name: string;}Write delay line tap
wax.tapOut(props, x)props { key?: string; name: string;}
x
Read delay line tap
wax.sample(props, trigger, rate)props { key?: string; path: string; mode?: string; startOffset?: number; stopOffset?: number;}
trigger
rate
Play audio sample from buffer
wax.table(props, t)props { key?: string; path: string;}
t
Wavetable / lookup oscillator
wax.convolve(props, x)props { key?: string; path: string;}
x
Impulse response convolution reverb

Sequencing and logic

NodeParametersPurpose
wax.metro(props)props { key?: string; name?: string; interval?: number;}Metronome pulse at interval
wax.seq(props, trigger, reset)props { key?: string; seq: number[]; offset?: number; hold?: boolean; loop?: boolean;}
trigger
reset
Step sequencer (legacy)
wax.seq2(props, trigger, reset)props { key?: string; seq: number[]; offset?: number; hold?: boolean; loop?: boolean;}
trigger
reset
Multi-output step sequencer
wax.sparseq(props, trigger, reset)props { key?: string; seq: { value: number; tickTime: number;} []; offset?: number; loop?: boolean | number[]; interpolate?: number; tickInterval?: number;}
trigger
reset
Sparse pattern sequencer
wax.sparseq2(props, time2)props { key?: string; seq: { value: number; time: number;} [];}
time2
Sparse sequencer v2
wax.sampleseq(props, time2)props { key?: string; path: string; seq: { value: number; time: number;} []; duration: number;}
time2
Sample-triggering sequencer
wax.sampleseq2(props, time2)props { key?: string; path: string; seq: { value: number; time: number;} []; duration: number; stretch?: number; shift?: number;}
time2
Sample sequencer v2
wax.counter(gate)gateIncrement while gate high
wax.accum(xn, reset)xn
reset
Accumulate while gate high
wax.latch(t, x)t
x
Hold value while gate high (note pitch memory)
wax.once(props, x)props { key?: string; arm?: boolean;}
x
Fire once when trigger rises
wax.maxhold(props, x, reset)props { key?: string; hold?: number;}
x
reset
Hold maximum of input
wax.rand(props)props { key?: string; seed?: number;}Random value on trigger

MIDI in the graph

NodeParametersPurpose
wax.midinotein(...args)…argsMerged host + UI MIDI note stream
wax.midinoteallocate(props, ...children)props { key?: string; voices?: number;}
…children
Assign note-ons to polyphony voices
wax.midinoteunpack(props, ...children)props { key?: string; channel?: number;}
…children
Per-voice pitch and velocity
wax.midinoteshift(props, ...children)props { key?: string; steps: number;}
…children
Transpose MIDI note numbers

Multichannel (wax.mc)

NodeParametersPurpose
wax.mc.sample(props, gate)props { key?: string; path: string; mode?: string; startOffset?: number; stopOffset?: number;}
gate
Multichannel sample player
wax.mc.table(props, t)props { key?: string; path: string;}
t
Multichannel wavetable
wax.mc.sampleseq(props, time2)props { key?: string; path: string; seq: { value: number; time: number;} []; duration: number;}
time2
Multichannel sample sequence
wax.mc.sampleseq2(props, time2)props { key?: string; path: string; seq: { value: number; time: number;} []; duration: number; stretch?: number; shift?: number;}
time2
Multichannel sample sequence v2
wax.mc.capture(props, g, ...args)props { key?: string;}
g
…args
Multichannel capture buffer

Analysis and metering

NodeParametersPurpose
wax.scope(props, ...args)props { key?: string; name?: string; size?: number; channels?: number;}
…args
Send audio blocks to page for meters/waveforms
wax.meter(props, x)props { key?: string; name?: string;}
x
Level metering tap
wax.fft(props, x)props { key?: string; name?: string; size?: number;}
x
FFT analysis tap
wax.snapshot(props, trigger, x)props { key?: string; name?: string;}
trigger
x
Capture graph state snapshot
wax.capture(props, g, x)props { key?: string;}
g
x
Record signal to buffer

Signal utilities

NodeParametersPurpose
wax.select(g, a, b)g
a
b
Switch between inputs by index
wax.ms2samps(t)tConvert milliseconds to samples
wax.tau2pole(t)tTime constant → filter pole
wax.db2gain(db)dbDecibels to linear gain
wax.gain2db(gain)gainLinear gain to decibels
wax.hann(t)tHann window for overlap-add

Math and comparisons

NodeParametersPurpose
wax.add(...args)…argsSum signals
wax.sub(...args)…argsSubtract signals
wax.mul(...args)…argsMultiply / gain
wax.div(...args)…argsDivide signals
wax.mod(...args)…argsModulo
wax.min(...args)…argsMinimum of inputs
wax.max(...args)…argsMaximum of inputs
wax.pow(a, b)a
b
Power
wax.sin(x)xSine math
wax.cos(x)xCosine math
wax.tan(x)xTangent math
wax.tanh(x)xTanh soft clip
wax.abs(x)xAbsolute value
wax.sqrt(x)xSquare root
wax.exp(x)xExponential
wax.ln(x)xNatural log
wax.log(x)xLog
wax.log2(x)xLog base 2
wax.floor(x)xRound down
wax.ceil(x)xRound up
wax.round(x)xRound to nearest
wax.asinh(x)xInverse hyperbolic sine
wax.le(a, b)a
b
Less than or equal (logic)
wax.leq(a, b)a
b
Less or equal
wax.ge(a, b)a
b
Greater than or equal — common for MIDI gates
wax.geq(a, b)a
b
Greater or equal
wax.eq(a, b)a
b
Equal comparison
wax.and(a, b)a
b
Logical AND
wax.or(a, b)a
b
Logical OR

Other bundled exports

NodeParametersPurpose
wax.constant(props)props { key?: string; value: number;}Graph node (other)
wax.identity(props, x)props { key?: string; channel?: number;}
x
Graph node (other)