WaxNative labs

Companion labs for the WAX Native Developer Guide — read the guide first, then run each chapter lab (~5 min).

Read first: wax-native.html (full guide + node reference) · Same content on AudioFusion: WAX Native Developer Guide

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.

Ch. 1

Overview

Helper, graph, bridge vs browser preview.

Ch. 2

Get started

renderDevice, poke, didEmit(), hybrid pages.

Ch. 3

MIDI

midinotein, voices, UI keyboard.

Ch. 4

Automation

Host cc1–cc32, sliders, sync.

Ch. 5

Presets

DataTree collect/apply, deferred init.

Ch. 6

Instruments

Envelope, oscillators, poly synth.

Ch. 7

Effects

wax.in, host I/O, FX graph.

Ch. 8

Sequencing

WAX_Play / Stop, train / seq2.

Ch. 9

Scopes

wax.scope, events → canvas.

Ch. 10

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.

Ch. 2

Minimal tone

Boot + didEmit + pokes.

Ch. 2

Hybrid tone

Shared buildOut(wax).

Ch. 3

MIDI voice

midinotein → ADSR → keys.

Ch. 4

Automation gain

Slider → CC 1 mapping.

Ch. 5

Preset recall

collect / apply JSON.

Ch. 6

Poly synth

8-voice + filter.

Ch. 7

SVF lowpass FX

wax.in → filter → out.

Ch. 8

Transport hooks

WAX_Play / WAX_Stop.

Ch. 9

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