Developer Example Index
Step-by-step lessons and runnable HTML for building inside the WAX plugin with
WaxNative — Elementary graphs compiled to native audio, with optional browser preview.
WaxNative.create() picks one runtime: in WAX your graph goes to the native engine; in Chrome the same wax.* API runs in local Web Audio. Preview is for UI/graph dev only.
wax.in.
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);
Lessons
Nine chapters (same order as the WordPress guide). Each lesson has inline Try it widgets + a full demo page.
Overview
create(), page vs engine, plugin vs browser.
Boot & render
render, poke, didEmit().
Audio
wax.in, FX, wax.const knobs.
Host
Channels, sample rate, block size.
Ch. 5MIDI
midinotein, ADSR, UI keyboard.
Transport
WAX_Play / WAX_Stop / WAX_BPM.
DataTree
Presets, deferred init, didEmit().
Scopes
wax.scope, events → canvas.
Browser preview
One HTML, plugin + Chrome.
Example HTML (runnable)
Full pages with demo UI + collapsible example source — open in WAX or Chrome.
Minimal tone
Smallest boot + emit pattern.
DemoSVF lowpass FX
wax.in → filter → out.
Poly synth
8-voice keyboard.
DemoScope visualizer
Scope events → waveform.
DemoHybrid tone
Shared buildOut(wax).
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
- NATIVE.md — full API + AI rules
- WEB.md — WaxWeb (Web Audio)
- WAX Dev Helper — DataTree, transport via WaxWeb