How to add FAUST DSP effect to JUCE Application

Hello, I’m building a standalone app (iOS) and wish to incorporate Faust DSP effects to it. I don’t want the GUI part, just the processing and access to the parameters from code. I’d love to have some kind of “processNextBlock” kind of function or something similar.
I have tried many approaches : build .dsp file to source/juce, build it to juce/plugin…
I’d like to add it to a basic app for example, but I keep struggling with errors and general misunderstanding of how this should be done.
So what is the easiest way to add Faust DSP processing inside my Juce App ?
Thanks for the help :slight_smile:

I think you would need to use the Faust facility to generate C++ code from Faust code and build that C++ code into your app. Especially on iOs, since that platform doesn’t allow code generation/compilation to happen on the device itself.

Hi Xenakios, thanks for the answer
I was just looking into this too, the cpp file looks a lot more simple and easy to implement indeed.
However it is very weird and not working. The whole class wants to inherit from a “dsp” class which it cannot find, something I am not understanding here

#include <algorithm>
#include <cmath>
#include <math.h>

class mydsp : public dsp 
{ //code

I’m uploading the cpp file which is very short, simple sine wave generator
osc.cpp (5.1 KB)

If I comment the things that prevent from compiling, I get a link command failed because of duplicate symbols, which I don’t find, so it’s driving me a bit crazy :slight_smile:

Should I be compiling it as a library before integrating it inside the projucer ? What is this “dsp” class I seem to be missing ?

I would guess the “dsp” base class is in some .h file provided by Faust and you need to add it in your include path. Oddly, the generated .cpp file does not appear to itself have an include for it…Anyway, surely they have some documentation/examples how to use the stuff?

Well it looks like the pure cpp source code generated by juce is not making things any easier, so I’m back to trying to integrate the juce plugin file generated by faust.

I think this should be easy for anyone familiar with juce, but I’m just getting started.

I have a .cpp file that I add to my source folder. I can’t get it to work. If I compile it, the project builds, but I can’t access the classes inside the file. If I include it, I get linker duplicate symbols errors when building. Here’s a link to the file, still a simple sine oscillator : FaustPluginProcessor.cpp (448.6 KB)

I realise this is probably a basic stupid cpp question but I’ve been struggling with this all day! How are my supposed to integrate this code to my project ? Thanks a lot for the help :slight_smile:

1 Like

Have you tried faust2juce ? (see ( et

Don’t know if this is of any help but take a look here:

This is a pretty good quality open source plugin using Faust as the dsp engine