Skip to content

Compiling Faust code for Bela

giuliomoro edited this page Mar 2, 2018 · 19 revisions

Since we currently only have alpha support for Faust on Bela, there is not much documentation here at the moment, however the below should get you started, whether or not you are familiar with Faust.

Interfacing with analog and digital pins

To interface Bela's analog and digital inputs, you need to edit the labels to follow the naming scheme: [BELA:ANALOG_0] or [BELA:DIGITAL_0]:

freq     = hslider("[1]Frequency[BELA:ANALOG_0]", 440 ,460, 1500, 1)
    :smooth(0.999);
pressure = hslider("[2]Pressure[style:knob][BELA:ANALOG_4]", 0.96, 0.2, 2.0, 0.01)
    :smooth(0.999):min(0.99):max(0.2);
gate     = hslider("[0]ON/OFF (ASR Envelope)[BELA:DIGITAL_0]",0,0,1,1);

See also this dsp file as an example.

Running FAUST code on Bela

Depending on the version of the Bela image you are running, you have different options to run FAUST:

Bela image v0.2.1 or below:

compile

There are several ways to compile FAUST patches for Bela:

  1. online playground — Go to http://faust.grame.fr/faustplayground and either find some example patches in the BIBLIO and drop them on the playground, or upload your own dsp file. Connect the audio output to preview in the browser, hit export, select Bela->exporter to build and then telecharger to download the compiled binary.
  2. local compiler install faust locally and use the faust2bela script.
  3. online compiler — Use the online compiler at http://faust.grame.fr/onlinecompiler. Here you can also download the Bela architecture file created by Oli Larkin and Stéphane Letz.

Bela image v0.3 or above:

This is a bit more convoluted and requires installing and compiling faust on your board and using a special Bela project. Follow the instructions here: https://github.com/giuliomoro/bela-faust-jit

Clone this wiki locally