Chapter 4 of 9
Host
Ask the DAW how many channels and what sample rate the plugin sees — then size I/O and UI labels to match.
Host queries
const sr = wax.host.sampleRate(); const block = wax.host.blockSize(); const ins = wax.host.inputChannels(); // 1 or 2 typical const outs = wax.host.outputChannels();
Routing
- FX: use
wax.in({ channel: 0 })/1up toins - 1. Mono tracks often only energize channel 0. - Synths: usually ignore inputs; still call
outputChannels()if you render mono vs stereo deliberately. - Browser preview: host fields reflect the Web Audio path (still useful for layout); bridge fields match the real plugin when
WaxNative.hasBridge()is true.
When to read host info
After await WaxNative.create(), before the first render. Re-read only if you handle dynamic I/O changes (uncommon on Custom Pages).
Try it
Transport timing and playhead APIs live on WaxWeb for Web Audio apps; native graphs use Transport callbacks and engine nodes instead.
Example code
Snippets from this lesson — combine in your Custom Page.
Loading…