Chapter 6 of 9

Transport

WAX calls global hooks when the DAW transport moves. Update play state and re-render the graph — do not rebuild timing with page timers.

DAW callbacks

let playing = false;

window.WAX_Play = function () {
  playing = true;
  renderGraph();
};

window.WAX_Stop = function () {
  playing = false;
  renderGraph();
};

window.WAX_BPM = function (bpm) {
  tempoBpm = bpm;
  renderGraph();
};

Clocks & sequencers

Put stepping logic in the graph (train, seq2, gates tied to transport) instead of setInterval that calls render every 16th note. Page timers pause or drift when the editor is hidden; the engine keeps time with the host.

Commit timing

Call renderGraph() synchronously inside WAX_Play / WAX_Stop — not deferred through requestAnimationFrame. Optional slider debounce (~16 ms) is fine for knobs; transport edges should stay immediate.

Try it

Web Audio transport helpers: WAX Dev Helper · WEB.md

Example code

Snippets from this lesson — combine in your Custom Page.

Loading…