FAUST

Run a FAUST DSP program from a compiled WASM module and process audio through it.

What it does

FAUST loads a compiled FAUST DSP program and runs it as a live audio node in the graph. The DSP is written and compiled elsewhere (faust.grame.fr, or the faust compiler targeting WASM); this node points at the resulting .wasm file, runs it in real time and streams the result out as stereo audio.

A FAUST program's own parameters vary from patch to patch, so the node exposes three generic numeric knobs (Param 0–2) that map onto whatever controls the loaded DSP exposes, plus the sample rate it runs at. Wire audio into Audio In to run the module as an effect (a filter, distortion or delay processing an existing signal). Leave Audio In unwired to run the module as a generator (a synth or oscillator producing sound from nothing).

When to use it

ParameterTypeDefault
wasm_fileString""
param_0Number0.500
param_1Number0.500
param_2Number0.500
sample_rateNumber44100
audio_inNumberArray

Gotchas

Param 0, 1 and 2 are generic slots and carry none of the real control names from the patch. Check the Param Info output, or the DSP source, for what each slot drives.

Audio In is optional. Disconnected, the patch runs as a self-contained generator; wired, it processes the incoming signal as an effect.

A companion .json file is expected next to the .wasm, the usual output of the FAUST WASM compiler. It carries the parameter and I/O metadata needed to run the module correctly.

Changing the WASM file, or nudging Sample Rate, reloads the DSP module from scratch. Internal state the patch was holding (envelopes, delay lines, filter memory) resets at that point.

Worked example

  1. Compile the .dsp file to WASM (e.g. via faust.grame.fr) and add a FAUST node.

  2. Set Wasm File to the compiled .wasm path, keeping its companion .json alongside it.

  3. Adjust Param 0–2 to taste, checking Param Info for what each one controls.

  4. Optionally wire an audio signal into Audio In to run the patch as an effect; otherwise it runs as a generator.

  5. Take Audio Left / Audio Right into a Mixer or straight to output.

See also

Audio Mixer · Additive Synth · Audio Analysis · Numbers, signals & audio