Skip to content
Phil Schatzmann edited this page Jun 1, 2022 · 16 revisions

Faust (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing applications and audio plug-ins for a variety of platforms and standards.

The core component of Faust is its compiler. It allows to "translate" any Faust digital signal processing (DSP) specification to a wide range of non-domain specific languages such as C++, C, LLVM bit code, WebAssembly, Rust, etc. In this regard, Faust can be seen as an alternative to C++ but is much simpler and intuitive to learn.

We use Faust to generate a C++ file that we can include in our Arduino sketch.

The following scenarios are supported:

Using the Online WEB IDE

  • Open the web IDE and write or load your Faust Program.
  • Click on the Export (the one with the Truck!)
  • In Platform select source
  • In Architecture select cplusplus
  • Click on Compile
  • Clock on Download
  • Rename the generated cpp file to .h and move it to the Arduino Sketch Directory

Using Faust Command Line

You can generate the C++ code with the help of the command line.

faust filename.dsp -o filename.h

ESP32 and PSRAM

The RAM of the microcontrollers is limited and Faust sometimes generates code which does not fit into the available RAM. The ESP32 AudioKit and ESP32 WROVER modules have PSRAM that can be used. In order to use PRSAM we need to use the memory manager. An example how to do this can be found in streams-faust_flute_i2s!

In this case we need to use the -mem option when we compile the sketch to cpp code:

faust -mem fluteMIDI.dsp -o fluteMIDI.h
Clone this wiki locally