Chapter 9 of 10
Scopes
Companion lab · Read full chapter in the guide →
Tap audio with wax.scope, receive blocks via native events, draw on canvas in requestAnimationFrame.
In this lab you will
- Wrap a signal with
wax.scope({ name, size, channels }, …) - Handle
receiveWaxNativeEvent("scope", …)andWAX_NativeEventmessages - Match payload
sourceto your scopename
Minimal pattern
const out = wax.scope({ name: "main", size: 512, channels: 1 }, tone);
wax.render(out, out);
window.WAX._internal.receiveWaxNativeEvent = function (name, payload) {
if (name === "scope") handleScopePayload(payload);
};
Try it
Example code
Loading…