Make LV2 plugins with Faust

Faust Web IDE

Faust (Functional Audio Stream) is an interesting programming language for sound synthesis and audio processing.

Faust web IDE
Compile from Faust web IDE

Make your first plugin

The example is very interesting but we can start with a simple noise plugin.

declare name "Noise";declare version "0.1";
declare author "You";
declare license "The licence you want";
declare copyright "(c)You 2021";
import("stdfaust.lib");volume = hslider("Volume", 0.5, 0, 1, 0.1);
noise = no.noise;
process = noise * volume;
declare version "0.1";
declare author "You";
declare license "The licence you want";
declare copyright "(c)You 2021";
import("stdfaust.lib");
volume = hslider("Volume", 0.5, 0, 1, 0.1);
volume = hslider("Volume", 0.5, 0, 1, 0.1);
process = noise * volume;
process = noise * volume
with {
noise = no.noise;
volume = hslider("Volume", 0.5, 0, 1, 0.1);
};
volume = hslider("Volume[style:knob]", 0.5, 0, 1, 0.1);

Live lv2 Coding plugin with Mephisto

Sometimes is enough to use the web IDE with its run button, but sometimes we want to develop it in a more complex environment. So we can develop our plugin using the Mephisto lv2 plugin that is an lv2 plugin with a code area in witch we can code directly into our DAW.

mephisto screenshot

Develop on my pc

If you want to compile and develop without the web IDE you need to install faust and if you want something like the web ide you can install faustlive.

The Codebase and Continous Delivery

If you are not interested in releasing your code publicly or you do not want a CD (Continous Delivery) pipeline skip to the conclusion.

build-lv2:
image: registry.gitlab.com/nicolalandro/simple-pink-noise
script:
- faust2lv2 <FILE_NAME>.dsp
- mkdir lv2_no_gui
- cp -r <FILE_NAME>.lv2 lv2_no_gui
- faust2lv2 -qt5 <FILE_NAME>.dsp
- mkdir lv2_qt
- cp -r <FILE_NAME>.lv2 lv2_qt
- tar -czvf <FILE_NAME>.tar.gz lv2_no_gui lv2_qt
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file <FILE_NAME>.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/<RELEASE_NAME>/0.0.1/<FILE_NAME>.tar.gz"'

Faust Docker container

Up to now, I do not find an official version of Docker container, so I create the container “registry.gitlab.com/nicolalandro/simple-pink-noise” used in the script for Simple Pink a pink noise lv2 plugin.

FROM debian:stable-slim

RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/grame-cncm/faust.git

WORKDIR /faust
RUN git submodule update --init

RUN \
apt-get update && \
apt-get install -y build-essential llvm libncurses5-dev libncurses5 libmicrohttpd-dev git cmake pkg-config && \
rm -rf /var/lib/apt/lists/*

RUN \
make && make install && \
make clean && \
apt-get purge -y build-essential llvm libncurses5-dev && apt-get autoremove -y

# lv2 compile
RUN apt-get update && apt-get install -y g++ lv2-dev libboost-dev

# delivery gitlab-ci
RUN apt-get update && apt-get install -y curl

# qt5 compile (it need qmake-qt5 not qmake)
RUN apt-get update && apt-get install -y qt5-default
RUN ln -sf /usr/lib/qt5/bin/qmake /usr/lib/qt5/bin/qmake-qt5
RUN ln -sf /usr/bin/qmake /usr/bin/qmake-qt5
docker login registry.gitlab.com
docker build -t registry.gitlab.com/<UNAME>/<CODEBASE_NAME> .
docker push registry.gitlab.com/<UNAME>/<CODEBASE_NAME>
image: registry.gitlab.com/<UNAME>/<CODEBASE_NAME>

Conclusions

This is my first solution to develop lv2 plugin with Faust so if you have corrections or only to start a discussion comment this post!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nicola Landro

Nicola Landro

86 Followers

Linux user and Open Source fun. Deep learning PhD Student, Full stack web developer, Mobile developer, Musitian.