FAUST (programming Language) - Block-diagram Composition

Block-diagram Composition

Contrary to Max-like visual programming languages where the user does manual connections, FAUST primitives are assembled in block diagrams by using a set of high-level block diagram composition operations. You can think of these composition operators as a generalization of the mathematical function composition operator.

The block-diagram composition operators used in FAUST
f~g Recursive composition (precedence 4)
f,g Parallel composition (precedence 3)
f:g Sequential composition (precedence 2)
f<:g Split composition (precedence 1)
f:>g Merge composition (precedence 1)

Let’s say that we want to connect the output of + to the input of abs in order to compute the absolute value of the output signal. This connection can be done using the sequential composition operator ':' (colon):

process = + : abs;

Here is an example of parallel composition (a stereo cable) using the operator ',' that puts in parallel its left and right expressions:

process = _,_;

These operators can be arbitrarily combined. For example to multiply the input signal by 0.5 one can write:

process = _,0.5 : *;

Taking advantage of some syntactic sugar the above example can be rewritten (using what functional programmers know as curryfication):

process = *(0.5);

The recursive composition operator '~' can be used to create block-diagrams with cycles (that include an implicit one-sample delay). Here is the example of an integrator that takes an input signal X and computes an output signal Y such that Y (t) = X(t) + Y(t−1):

process = + ~ _;

Read more about this topic:  FAUST (programming Language)

Famous quotes containing the word composition:

    Give a scientist a problem and he will probably provide a solution; historians and sociologists, by contrast, can offer only opinions. Ask a dozen chemists the composition of an organic compound such as methane, and within a short time all twelve will have come up with the same solution of CH4. Ask, however, a dozen economists or sociologists to provide policies to reduce unemployment or the level of crime and twelve widely differing opinions are likely to be offered.
    Derek Gjertsen, British scientist, author. Science and Philosophy: Past and Present, ch. 3, Penguin (1989)