Chapter 1 of 9
Overview
WaxNative turns an Elementary audio graph in JavaScript into instruction batches the WAX plugin runs natively — your HTML is the UI, not the DSP engine.
Two environments
- Inside WAX —
WaxNativeis injected with the bridge.await WaxNative.create()returns a sync native instance; audio runs in the plugin even when the editor closes (graph + host MIDI keep working). - Outside WAX (Chrome) — load
wax-native.js;create()returns a Promise, fetcheswax-web-audio.js, and runs the same node vocabulary in Web Audio for preview.
Chrome: Use the full helper URL in <script src> (see overview). Click once to unlock audio outside WAX.
Minimal flow
const wax = await WaxNative.create(); const tone = wax.mul(wax.cycle(440), 0.15); wax.render(tone, tone); // dual mono — safe default
Always build nodes on the instance from create() — use wax.cycle, not a separate graph library from a CDN.
Static helpers
WaxNative.hasBridge()— true when the real plugin inject is present.WaxNative.keepAlive()— keeps the WebView foreground so timers and UI MIDI stay reliable.WaxNative.version/minPlugin— semver metadata for compatibility checks.
Try it
Full page: Minimal tone demo
Example code
Snippets from this lesson — combine in your Custom Page.
Loading…