Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Linux and Faust-Generated SuperCollider Plugins

The examples below were last fully tested on a Fedora 15 64-bit Linux system running FAUST version 0.9.43 (on 8/4/2011), and later updated based on email feedback in May of 2020. If anything else needs updating, please let me know via email.

The shell script faust2supercollider can be used to create a SuperCollider (SC) plugin from a FAUST source file:

  > faust2supercollider mysynth.dsp
The resulting class file (the sclang ``extension'') and shared-object file (the scsynth or supernova ``plugin'') can be copied from the current working directory to your SC extensions directory, typically as follows on Linux systems:
  > mkdir -p ~/share/SuperCollider/Extensions/Faust/
  > cp mysynth.s[co] ~/share/SuperCollider/Extensions/Faust/.
Below we speak of using scsynth as the SuperCollider sound-synthesis server, but supernova, the more recent multithreaded generalization of scsynth, should also work in its place.

To try out the FAUST example osc.dsp, for example, first copy the generated files into your SC extensions directory:

  cp <faust>/examples/supercolliderdir/osc.s[co] ~/share/SuperCollider/Extensions/Faust
Next, restart sclang and scsynth,21 and execute the following code in sclang:
  y = {
      var out;
      out = {,volume:-40.0)}.dup;
You should hear a soft sinusoid at frequency 100 Hz. (Execute ``;'' when you are tired of listening to it, which will likely be quite soon.)

The FaustOsc class in the file created by the make is as follows:

  FaustOsc : UGen
      *ar { | freq(1000.0), volume(0.0) |
          ^this.multiNew('audio', freq, volume)
      *kr { | freq(1000.0), volume(0.0) |
          ^this.multiNew('control', freq, volume)
      name { ^"osc" }
We see for example that the default frequency and volume are $ 1$ kHz and 0 dB, respectively. Adapting a cool example from the SuperCollider Book, we can control the amplitude and frequency of the oscillator with the mouse as follows:
  z = {
      var out;
      out = (
  ,3000,\exponential), // freq (Hz)
  ,10,\linear) // amp (dB)
            ) *;  // gate = LEFT mouse button

Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download aspf.pdf
[Comment on this page via email]

``Audio Signal Processing in Faust'', by Julius O. Smith III.
Copyright © 2021-04-07 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University