... 1
Work supported by the Wallenberg Global Learning Network
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... language|textbf2
The Faust home page is http://faust.grame.fr/. Faust is included in the Planet CCRMA distribution (http://ccrma.stanford.edu/planetccrma/software/). The examples in this module have been tested with Faust version 0.9.9.2a2.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... environments.3
Faust ``architecture files'' and plugin-generators are currently available for Max/MSP, Pd [3,1], VST, LADSPA, ALSA-GTK, JACK-GTK, and SuperCollider, as of this writing.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...4
A ``with'' block is not required, but it minimizes ``global name pollution.'' In other words, a definition and its associated with block are more analogous to a C function definition in which local variables may be used. Faust statements can be in any order, so multiple definitions of the same symbol are not allowed. A with block can thus be used also to override global definitions in a local context.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... background.5
Facility with basic C++ programming is also assumed for this module.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... signals,6
A causal signal is any signal that is zero before time 0.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...cpgr.dsp.7
The faust2firefox script can be used to generate SVG block diagrams and open them in the Firefox web browser.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... response:8
This specific output was obtained by editing cpgrir-print.cpp to replace %8f by %g in the print statements, in order to print more significant digits.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...9
In many cases the signal processing in Faust can occur within a ``foreign function'' written in C or C++ and used as a ``black box'' within Faust, like the cos() function in Fig.5. However, this approach is presently limited because foreign functions can have only float and int argument types, and they can only return a float each sample. It is possible to set up persistent state in a foreign function by means of static variables, but this does not generalize easily to multiple instances. Therefore, more general extensions may require direct modification of the generated C++, which usually obsoletes the Faust source code.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... patch,10
All manually generated .dsp files and pd patches in this module are available at http://ccrma.stanford.edu/realsimple/faust/faustpd.tar.gz.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...cpgrui~-help.pd,11
In pd, a dynamically loadable module (pd plugin) is called an abstraction. (This is distinct from the one-off subpatch which is encapsulated code within the parent patch, and which resides in the same file as the parent patch [4].) It is customary to document each abstraction with its own ``help patch''. The convention is to name the help patch ``name-help.pd'', where ``name'' is the name of the abstraction. Right-clicking on an object in pd and selecting ``Help'' loads the help patch in a new pd window.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...loadbang12
The loadbang object sends a ``bang'' message when the patch finishes loading.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...synth.pd.13
On a Linux system with Planet CCRMA installed, the command ``locate synth.pd'' should find it, e.g., at /usr/share/doc/faust-pd-0.9.8.6/examples/synth/synth.pd .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... adding14
After running jack-rack, the LADSPA plugin was added by clicking on the menu items ``Add / Uncategorised / C / Constant_Peak_Gain_Resonator''. If jack-rack does not find this or other plugins, make sure your LADSPA_PATH environment variable is set. A typical setting would be /usr/local/lib/ladspa/:/usr/lib/ladspa/.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...fig:jack-rack-connect.15
Sound routings such as this may be accomplished using the ``Connect'' window in qjackctl. In that window, there is an Audio tab and a MIDI tab, and the Audio tab is selected by default. Just click twice to select the desired source and destination and then click ``Connect''. Such connections can be made automatic by clicking ``Patchbay'' in the qjackctl control panel, specifying your connections, saving, then clicking ``Activate''. Connections can also be established at the command line using aconnect from the alsa-utils package (included with Planet CCRMA).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...Receptor|textbf.16
The Receptor is a hardware VST plugin host designed for studio work and live musical performance. While it only supports Windows VST plugins, it is based on a Red Hat Linux operating system using wine for Windows compatibility. The VST plugin described in this section was tested on system version 1.6.20070717 running on Receptor hardware version 1.0. This system expects VST-2.3 plugins, and so VST-2.4 plugins cause a warning message to be printed in the Receptor's system log. However, v2.4 plugins seem to work fine in the 2.3 framework. There was a competitor to the Receptor called Plugzilla that supported both VST and LADSPA plugins, but Plugzilla no longer appears to be available.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... input.17
Pd must have at least one MIDI-input port defined at startup for this to work. For example, a typical ~/.pdrc file might contain the following startup options for pd:
-jack -r 48000 -alsamidi -midiindev 1 -midioutdev 1 -audiooutdev 1 -outchannels 2 -path /usr/lib/pd/...
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.