Faust: Sequential Composition

Sequential composition is used for passing signals directly from one block to another block. In Faust, this is done with the : operator. The following example illustrates this with a square wave signal, which is processed with a low pass filter:

text


The square wave has a fixed frequency of $50\ \mathrm{Hz}$. The lowpass filter has two arguments, the first being the filter order, the second the cutoff frequency, which is controlled with a horizontal slider. Both blocks are defined and subsequently connected in the process function with the : operator. The adjustable cutoff parameter is additionally smoothed with si.smoo to avoid clicks.

Load this example in the Faust online IDE for a quick start:

import("stdfaust.lib");

freq  = hslider("frequency",100, 10, 1000, 0.001);

sig  = os.square(50);
filt = fi.lowpass(5,freq);

process = sig:filt;