Faust: Compile for SuperCollider
Faust can be used to compile SuperCollider extensions.
For the sine.dsp
example in the introduction:
$ faust2supercollider sine.dsp
This will produce two files:
the class file
sine.sc
the binary
sine.so
Note that faust2supercollider depends on ruby,
which you may need to install. If missing, the .sc
files will be empty. There are now warnings or errors,
so this can be confusing.
Both files need to be placed in the system's SuperCollider extension directory and the class library needs to be recompiled. The class name in SuperColldier is generated by Faust:
FaustSine : UGen { *ar { | frequency(100.0), gain(0.0) | ^this.multiNew('audio', frequency, gain) } *kr { | frequency(100.0), gain(0.0) | ^this.multiNew('control', frequency, gain) } name { ^"FaustSine" } info { ^"Generated with Faust" } }
The new class can be used like this:
{FaustSine.ar(100,1)}.play;