Faust: Splitting and Merging Signals
Splitting a Signal
To Stereo
The <:
operator can be used to split a signal into an arbitrary number of branches.
This is frequently used to send a signal to both the left and the right channel of a computer's output device.
In the following example, an impulse train with a frequency of $5\ \mathrm{Hz}$ is generated and split into a stereo signal.
To Many
The splitting operator can be used to create more than just two branches. The following example splits the source signal into 8 signals:
To achieve this, the splitting directive can be extended by the desired number of outputs:
Merging Signals
Merging to Single
The merging operator :> in Faust is the inversion of the splitting operator. It can combine an arbitrary number of signals to a single output. In the following example, four individual sine waves are merged:
Input signals are separated by commas and then joined with the merging operator.
Merging to Multiple
Merging can be used to create multiple individual signals from a number of input signals. The following example generates a stereo signal with individual channels from the four sine waves:
To achieve this, two output signals need to be assigned after merging: