Link Search Menu Expand Document

Faust

Faust

Faust is a domain-specific programming language, tailored for writing digital signal processing code, for instance audio effects and synthesizers, super easily.

It is mainly developed at Grame, with an international community of contributors.

For syntax, signal composition, controls and the standard DSP library, see the Faust language reference. This page covers the score process workflow, setup and project packaging.

Faust DSP files can be drag’n’dropped directly inside a score. This will compile the DSP and embed it as a signal processor in the score. Additionally, any .dsp file found recursively in the library folder will be detected and added under the Faust section in the process library.

Faust code can be edited directly from within the user interface, by clicking on the small “window” icon on the node header. One must press “Compile” when the code is ready to update it to the audio engine.

Ports and controls

The DSP determines the number of audio channels. Faust sliders, numeric entries, buttons and checkboxes become score controls, so the process interface changes with the compiled program. A synthesizer using the conventional freq, gain and gate controls is detected as MIDI-driven; a normal effect processes its audio input instead.

See the score integration contract and control syntax for the distinction between Faust language primitives and score’s host interface.

Imports and portable projects

When a .dsp file is loaded, score embeds its source text in the document and remembers the original file’s directory as an additional import search path. For example, an import("my-library.lib"); can resolve a library beside that DSP file. Editing the embedded code is not the same as editing the original file on disk.

score saves this import directory relative to the score library or project where possible, and resolves it again when loading. This lets a project or library move without unnecessarily retaining the old machine’s absolute path. Imports still need the referenced files: embedding the DSP does not embed every imported .lib.

Keep local Faust libraries with the project, or install them as a score package on every machine that opens it. The project media tools report the import folder as an external dependency, but do not automatically collect or rewrite the whole Faust library tree. When using Save as, verify imports still resolve if the destination no longer contains the same files.

FAUST_LIB_PATH can override the bundled Faust library location; see command-line and environment options. Compilation requires a build with Faust support and a usable library search path, not just the presence of the .dsp file.

Important links

Video tutorial

Faust packages

It is possible to provide new Faust libraries as score packages.

This is done for instance with Alain Bonardi’s abclib which is packaged here : most importantly, the library folder in such a package will be added to the Faust library path so that new functions can be provided.