WaxNative labs
Companion labs for the WAX Native Developer Guide — read the guide first, then run each chapter lab (~5 min).
Hello Wax
Read the snippet, press Play — browser or WAX native path.
const wax = await WaxNative.create(); const tone = wax.mul(wax.cycle(440), 0.12); wax.render(tone, tone);
Chapter labs (1–10)
One lab per guide chapter — checklist + minimal snippet + Try it where available.
Chapter 11 (all wax.* nodes) lives in the guide only.
Overview
Helper, graph, bridge vs browser preview.
Ch. 2Get started
renderDevice, poke, didEmit(), hybrid pages.
MIDI
midinotein, voices, UI keyboard.
Automation
Host cc1–cc32, sliders, sync.
Presets
DataTree collect/apply, deferred init.
Ch. 6Instruments
Envelope, oscillators, poly synth.
Ch. 7Effects
wax.in, host I/O, FX graph.
Sequencing
WAX_Play / Stop, train / seq2.
Scopes
wax.scope, events → canvas.
Troubleshooting
Silent load, presets, ship checklist.
Reference: all wax.* nodes —
Chapter 11 in wax-native.html
Example HTML (runnable)
Full pages with demo UI + collapsible example source — open in WAX or Chrome.
Minimal tone
Boot + didEmit + pokes.
Hybrid tone
Shared buildOut(wax).
MIDI voice
midinotein → ADSR → keys.
Automation gain
Slider → CC 1 mapping.
Ch. 5Preset recall
collect / apply JSON.
Poly synth
8-voice + filter.
Ch. 7SVF lowpass FX
wax.in → filter → out.
Transport hooks
WAX_Play / WAX_Stop.
Scope visualizer
Scope events → canvas.
Quick reference
Script
<script src="https://szfpro.github.io/CodeEditorHTML/wax-native.js"></script>
Create & render
await WaxNative.create()
WaxNative.hasBridge()
WaxNative.keepAlive()
wax.render(outL, outR)
wax.didEmit()
wax.reemitLast("retry")
Host · MIDI · FX · scope
wax.host.sampleRate()
await wax.midi.ready(); wax.midi.noteOn(60, 100)
wax.in({ channel: 0 }); await wax.connectMic()
WAX._internal.receiveWaxNativeEvent("scope", payload)
Related
- wax-native.html — developer guide · wax-api.html — all nodes + parameters
- WEB.md — WaxWeb (Web Audio)
- WAX Dev Helper — DataTree, transport via WaxWeb