Cover photo by Grant Hussey @gthussey_art

The other night I started exploring the idea of getting DAWs and plugins to run in the browser with WASM and it was a lot more interesting than I thought it would be... I can totally see some kind of hackathon project here.

DAWs and audio/instrument plugins today

I got into this when I was exploring the possibility of creating a DAW (Digital Audio Workstation like Logic Pro or Ableton Live) in the browser leveraging WASM for plugins and other complex operations. The main idea here is to be able to use all of the existing plugins (like Serum, Massive, etc) by some how recompiling them to WASM.

After some research, it was obvious that this would not work. Long story short, plugins are distributed as libraries (.dll, .so, etc.) and use a ton of IO and host related dependencies for UI and other features making them a very bad candidate for WASM. So porting over existing plugins won't work, but the core concept of an audio plugin actually conforms very nicely with the WASM spec!

Here is a quote from the Steinberg Media VST documentation. VST is a very popular piece of (proprietary, boo) software for developing plugins.

A VST plug-in is an audio processing component that is utilized within a host application. This host application provides the audio or/and event streams that are processed by the plug-in's code. Generally speaking, a VST plug-in can take a stream of audio data, apply a process to the audio, and return the result to the host application. A VST plug-in performs its process normally using the processor of the computer.

In general, plugins only stray from this simple spec when they need to implement UI, or do other complex operations like DRM locking.

Web Audio Modules

And now the coolest thing I've seen in a while, Web Audio Modules. The WAM project aims to enable the development of browser based DAWs by creating a spec around plugins (which are what make DAWs so fun and productive).

Here is a quote from the Spec Architecture page.

A WAM consists of Controller and Processor parts as shown in Fig. 1. The Controller exposes a JavaScript API, interfaces with other Web APIs, and optionally provides the GUI. The Processor implements signal processing algorithms in JavaScript or cross-compiled C/C++.

I think you see where this is going! UI/UX and other general business in HTML/JS, the heavy lifting in Rust/C++ compiled to WASM.

Here is an example repo that implements the Yamaha DX7 synth and it's corresponding demo. Remember to click the "toggle front panel" button!

I would have loved to embed one of the synths here, but sadly it seems like this project hasn't been touched in years and there's no documentation anywhere...