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.

Hybrid ≠ Chrome talking to the plugin. 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.
Chrome / Safari: Click Play or Start audio once (autoplay). FX lessons/demos need mic for wax.in.
Canonical AI doc: NATIVE.md · Long-form guide: 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);

Lessons

Nine chapters (same order as the WordPress guide). Each lesson has inline Try it widgets + a full demo page.

Ch. 1

Overview

create(), page vs engine, plugin vs browser.

Ch. 2

Boot & render

render, poke, didEmit().

Ch. 3

Audio

wax.in, FX, wax.const knobs.

Ch. 4

Host

Channels, sample rate, block size.

Ch. 5

MIDI

midinotein, ADSR, UI keyboard.

Ch. 6

Transport

WAX_Play / WAX_Stop / WAX_BPM.

Ch. 7

DataTree

Presets, deferred init, didEmit().

Ch. 8

Scopes

wax.scope, events → canvas.

Ch. 9

Browser preview

One HTML, plugin + Chrome.

Example HTML (runnable)

Full pages with demo UI + collapsible example source — open in WAX or Chrome.

Demo

Minimal tone

Smallest boot + emit pattern.

Demo

SVF lowpass FX

wax.in → filter → out.

Demo

Poly synth

8-voice keyboard.

Demo

Scope visualizer

Scope events → waveform.

Demo

Hybrid 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