WaxNative API reference
Every wax.* graph node with parameters. For tutorials, see wax-native.html · quick index: node index.
WaxNative & page API
| Node | Parameters | Purpose |
|---|---|---|
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 payload | Host 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 string | Retry 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–127 | UI keyboard → midinotein |
wax.midi.noteOff(note) | MIDI note | Release UI key |
wax.midi.cc(n, value) | Controller 1–127, value 0–127 | Host 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_BPM | BPM number for WAX_BPM | DAW 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
| Node | Parameters | Purpose |
|---|---|---|
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
| Node | Parameters | Purpose |
|---|---|---|
wax.cycle(rate) | rate | Sine oscillator — frequency in Hz |
wax.saw(rate) | rate | Sawtooth oscillator |
wax.square(rate) | rate | Square wave oscillator |
wax.triangle(rate) | rate | Triangle wave oscillator |
wax.train(rate) | rate | Pulse / clock train at frequency |
wax.phasor(rate) | rate | 0→1 ramp phasor at rate |
wax.syncphasor(rate, reset) | ratereset | Hard-synced phasor |
wax.blepsaw(rate) | rate | Band-limited saw (cleaner bends) |
wax.blepsquare(rate) | rate | Band-limited square |
wax.bleptriangle(rate) | rate | Band-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
| Node | Parameters | Purpose |
|---|---|---|
wax.svf(props, fc, q, x) | props { key?: string; mode?: string;}fcqx | State-variable filter (LP/HP/BP/notch/allpass modes) |
wax.svfshelf(props, fc, q, gainDecibels, x) | props { key?: string; mode?: string;}fcqgainDecibelsx | SVF-based shelf EQ |
wax.lowpass(fc, q, x) | fcqx | One-pole lowpass |
wax.highpass(fc, q, x) | fcqx | One-pole highpass |
wax.bandpass(fc, q, x) | fcqx | Bandpass filter |
wax.notch(fc, q, x) | fcqx | Notch filter |
wax.allpass(fc, q, x) | fcqx | Allpass filter |
wax.lowshelf(fc, q, gainDecibels, x) | fcqgainDecibelsx | Low shelf EQ |
wax.highshelf(fc, q, gainDecibels, x) | fcqgainDecibelsx | High shelf EQ |
wax.peak(fc, q, gainDecibels, x) | fcqgainDecibelsx | Peaking EQ band |
wax.biquad(b0, b1, b2, a1, a2, x) | b0b1b2a1a2x | Generic biquad coefficient filter |
wax.pole(p, x) | px | Real pole smoothing |
wax.mm1p(props, fc, x) | props { key?: string; mode?: string;}fcx | Moog-style one-pole |
wax.prewarp(fc) | fc | Bilinear prewarp for cutoff |
wax.smooth(p, x) | px | Smooth a control signal |
wax.sm(x) | x | Smooth (alias) |
wax.dcblock(x) | x | Remove DC offset |
wax.df11(b0, b1, a1, x) | b0b1a1x | First-order delay / filter building block |
wax.zero(b0, b1, x) | b0b1x | Delay / zero-pole helper |
wax.pink(x) | x | Pinking filter on white noise |
Envelopes and dynamics
| Node | Parameters | Purpose |
|---|---|---|
wax.adsr(attackSec, decaySec, sustain, releaseSec, gate) | attackSecdecaySecsustainreleaseSecgate | Amplitude envelope from gate/trigger |
wax.env(atkPole, relPole, x) | atkPolerelPolex | Simple envelope follower |
wax.compress(attackMs, releaseMs, threshold, ratio, sidechain, xn) | attackMsreleaseMsthresholdratiosidechainxn | Dynamics compressor |
wax.skcompress(attackMs, releaseMs, threshold, ratio, kneeWidth, sidechain, xn) | attackMsreleaseMsthresholdratiokneeWidthsidechainxn | Sidechain-aware compressor |
Delay, memory, and samples
| Node | Parameters | Purpose |
|---|---|---|
wax.delay(props, len, fb, x) | props { key?: string; size: number;}lenfbx | Delay line — time in seconds |
wax.sdelay(props, x) | props { key?: string; size: number;}x | Sample-based delay |
wax.z(x) | x | Single-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;}triggerrate | 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
| Node | Parameters | Purpose |
|---|---|---|
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;}triggerreset | Step sequencer (legacy) |
wax.seq2(props, trigger, reset) | props { key?: string; seq: number[]; offset?: number; hold?: boolean; loop?: boolean;}triggerreset | 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;}triggerreset | 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) | gate | Increment while gate high |
wax.accum(xn, reset) | xnreset | Accumulate while gate high |
wax.latch(t, x) | tx | 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;}xreset | Hold maximum of input |
wax.rand(props) | props { key?: string; seed?: number;} | Random value on trigger |
MIDI in the graph
| Node | Parameters | Purpose |
|---|---|---|
wax.midinotein(...args) | …args | Merged 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)
| Node | Parameters | Purpose |
|---|---|---|
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
| Node | Parameters | Purpose |
|---|---|---|
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;}triggerx | Capture graph state snapshot |
wax.capture(props, g, x) | props { key?: string;}gx | Record signal to buffer |
Signal utilities
| Node | Parameters | Purpose |
|---|---|---|
wax.select(g, a, b) | gab | Switch between inputs by index |
wax.ms2samps(t) | t | Convert milliseconds to samples |
wax.tau2pole(t) | t | Time constant → filter pole |
wax.db2gain(db) | db | Decibels to linear gain |
wax.gain2db(gain) | gain | Linear gain to decibels |
wax.hann(t) | t | Hann window for overlap-add |
Math and comparisons
| Node | Parameters | Purpose |
|---|---|---|
wax.add(...args) | …args | Sum signals |
wax.sub(...args) | …args | Subtract signals |
wax.mul(...args) | …args | Multiply / gain |
wax.div(...args) | …args | Divide signals |
wax.mod(...args) | …args | Modulo |
wax.min(...args) | …args | Minimum of inputs |
wax.max(...args) | …args | Maximum of inputs |
wax.pow(a, b) | ab | Power |
wax.sin(x) | x | Sine math |
wax.cos(x) | x | Cosine math |
wax.tan(x) | x | Tangent math |
wax.tanh(x) | x | Tanh soft clip |
wax.abs(x) | x | Absolute value |
wax.sqrt(x) | x | Square root |
wax.exp(x) | x | Exponential |
wax.ln(x) | x | Natural log |
wax.log(x) | x | Log |
wax.log2(x) | x | Log base 2 |
wax.floor(x) | x | Round down |
wax.ceil(x) | x | Round up |
wax.round(x) | x | Round to nearest |
wax.asinh(x) | x | Inverse hyperbolic sine |
wax.le(a, b) | ab | Less than or equal (logic) |
wax.leq(a, b) | ab | Less or equal |
wax.ge(a, b) | ab | Greater than or equal — common for MIDI gates |
wax.geq(a, b) | ab | Greater or equal |
wax.eq(a, b) | ab | Equal comparison |
wax.and(a, b) | ab | Logical AND |
wax.or(a, b) | ab | Logical OR |
Other bundled exports
| Node | Parameters | Purpose |
|---|---|---|
wax.constant(props) | props { key?: string; value: number;} | Graph node (other) |
wax.identity(props, x) | props { key?: string; channel?: number;}x | Graph node (other) |