v160 · multimedia · web audio

Shared tuning bus

A synth has many voices — one AudioWorkletNode each — but tuning is global. Without a shared port you either fan the same message out to every node’s port or keep a dummy node around as a mailbox. With it, the module keeps one tuning object in global scope and one audioWorklet.port.postMessage() retunes every voice. Here three voices (C4, E4, G4) are rendered offline and their pitch is measured from the samples, so you can see the message really landed.

Probing this browser…

transport: (not yet opened)

Three voices, one tuning message
voiceexpected Hzmeasured Hzverdict
Press “Render offline & measure”.

the worklet module

The tuning-mailbox processor at the bottom exists only for engines without the shared port: it is the bootstrap workaround, and this page uses it (and says so in the transport line) when audioWorklet.port is missing.

references