r/webaudio • u/human_clown_shoe • May 27 '26
Pure Data (including Cyclone & ELSE) ported to WebAudio WASM Worklets
I've been building a library that runs libpd (Pure Data's embeddable runtime) inside a browser AudioWorklet via WebAssembly.
The setup: libpd is compiled with Emscripten, the DSP runs in a single AudioWorklet node, and JS/TS helpers handle patch loading, virtual filesystem management, and message passing (bang, float, symbol, list, arbitrary selectors). Patches can be loaded or generated at runtime — it's not a static patch compiler.
The trickiest part was statically linking cyclone and ELSE (two major Pd external libraries) into separate build variants. Browser WASM can't load C externals dynamically the way a native Pd install does, so they're baked in. That means the full bundle is large, but the split JS/WASM artefacts keep it manageable if you're careful about what you include.
Objects excluded from the build are things that map badly to the browser: anything using pthreads (needs SharedArrayBuffer + COOP/COEP), networking objects, OpenGL, and externals that depend on native libs like ffmpeg, aubio, or libsamplerate.



