Deploying Faust DSP on the Web

Using developments done for the Web (WebAssembly backends and libfaust library compiled in WebAssembly with Emscripten), statically and dynamically Faust generated WebAudio nodes can be easily produced and deployed on the Web. See extended documentation here.

Note: this model will soon be deprecated, better use the faustwasm package.

Note: the faust2cpp2wasm tool can possibly be used as a drop in replacement for the wasm file generated by faust2wasm, but with Faust's C++ backend instead of its wasm backend.

The faustwasm package

The FaustWasm library presents a convenient, high-level API that wraps around Faust compiler. This library's interface is primarily designed for TypeScript usage, although it also provides API descriptions and documentation for pure JavaScript. The WebAssembly version of the Faust Compiler, compatible with both Node.js and web browsers, has been compiled using Emscripten 3.1.31.

The library offers functionality for compiling Faust DSP code into WebAssembly, enabling its utilization as WebAudio nodes within a standard WebAudio node graph. Moreover, it supports offline rendering scenarios. Furthermore, supplementary tools can be employed for generating SVGs from Faust DSP programs.

The faust-web-component package

Tthe faust-web-component package provides two web components for embedding interactive Faust snippets in web pages:

  • <faust-editor> displays an editor (using CodeMirror 6) with executable, editable Faust code, along with some bells & whistles (controls, block diagram, plots) in a side pane. This component is ideal for demonstrating some code in Faust and allowing the reader to try it out and tweak it themselves without having to leave the page, and can been tested here.

  • <faust-widget> just shows the controls and does not allow editing, so it serves simply as a way to embed interactive DSP, and can been tested here.

These components are built on top of faustwasm and faust-ui packages and is released as a npm package.