Custom Sporth ugens with faust using faust2sporth

Somewhat recently, I made it possible to load custom Sporth ugens through a sporth plugin format. This advancement in Sporth lead to the development of faust2sporth, a utility that generates sporth plugins from Faust code.


faust2sporth was created for the following reasons:


faust2sporth currently can be found in the Sporth codebase in the folder util/faust2sporth. The two files needed are the architecture file (sporth.cpp) and shell script (faust2sporth). On Linux, you could copy faust2sporth in a place like /usr/local/bin and the architecture file in a place like /usr/local/lib/faust.


Here is some simple Faust code, using an off-the-shelf cubic non-linear distortion generator put through a dcblocker:

 drive = hslider("[0]drive", 0, 0, 1, 0.0001);
 offset = hslider("[1]offset", 0, 0, 4, 0.0001);
 process = cubicnl(drive, offset) : dcblocker;

Like any faust2 utility, this can be compiled in the following way:

 faust2sporth dist.dsp

Which will create a file called "". This plugin can be loaded and executed in Sporth in the following way:

 'dist' './' fl
 # load an audio file
 'oneart.wav' diskin
 # Drive 
 # Offset
 'dist' fe
 'dist' fc