| 1 |
<chapter id="SignalFlowGraphOpcodes"> |
| 2 |
|
| 3 |
<title> |
| 4 |
Signal Flow Graph Opcodes |
| 5 |
</title> |
| 6 |
|
| 7 |
<para> |
| 8 |
These opcodes enable the use of signal flow graphs |
| 9 |
(AKA asynchronous data flow graphs) in Csound orchestras. |
| 10 |
Signals flow from the outlets of source instruments |
| 11 |
and are summed in the inlets of sink instruments. |
| 12 |
Signals may be krate, arate, frate, or arate arrays. |
| 13 |
Any number of outlets may be connected to any number of inlets. |
| 14 |
When a new instance of an instrument is instantiated during performance, |
| 15 |
the declared connections also are automatically instantiated. |
| 16 |
</para> |
| 17 |
|
| 18 |
<para> |
| 19 |
Signal flow graphs simplify the construction of complex mixers, |
| 20 |
signal processing chains, and the like. They also simplify the re-use |
| 21 |
of "plug and play" instrument definitions and even entire sub-orchestras, |
| 22 |
which can simply be #included and then "plugged in" to existing orchestras. |
| 23 |
</para> |
| 24 |
|
| 25 |
<para> |
| 26 |
Note that inlets and outlets are defined in instruments without reference |
| 27 |
to how they are connected. Connections are defined in the orchestra header. |
| 28 |
It is this separation that enables plug-in instruments. |
| 29 |
</para> |
| 30 |
|
| 31 |
<para> |
| 32 |
Inlets must be named. Instruments may be named or numbered, but in |
| 33 |
either case each source instrument must be defined |
| 34 |
in the orchestra before any of its sinks. Naming instruments makes |
| 35 |
it easier to connect outlets and inlets in any higher-level orchestra |
| 36 |
to inlets and outlets in any lower-level #included orchestra. |
| 37 |
</para> |
| 38 |
|
| 39 |
<para> |
| 40 |
The signal flow graph opcodes include: |
| 41 |
|
| 42 |
<link linkend="outleta"><citetitle>outleta</citetitle></link>, for |
| 43 |
sending an arate signal from any instrument out a named port. |
| 44 |
|
| 45 |
<link linkend="outletk"><citetitle>outletk</citetitle></link>, for |
| 46 |
sending a krate signal from any instrument out a named port. |
| 47 |
|
| 48 |
<link linkend="outletkid"><citetitle>outletkid</citetitle></link>, |
| 49 |
similar to outletk, but receiving a krate signal only from an identified instance of a port. |
| 50 |
|
| 51 |
<link linkend="outletf"><citetitle>outletf</citetitle></link>, for |
| 52 |
sending an frate signal from any instrument out a named port. |
| 53 |
|
| 54 |
<link linkend="outletv"><citetitle>outletv</citetitle></link>, for |
| 55 |
sending an arate array signal from any instrument out a named port. |
| 56 |
|
| 57 |
<link linkend="inleta"><citetitle>inleta</citetitle></link>, for |
| 58 |
receiving an arate signal through a named port. |
| 59 |
|
| 60 |
<link linkend="inletk"><citetitle>inletk</citetitle></link>, for |
| 61 |
receiving a krate signal through a named port. |
| 62 |
|
| 63 |
<link linkend="inletkid"><citetitle>inletkid</citetitle></link>, |
| 64 |
similiar to inletk, but transmitting a signal only between inlet and outlet opcodes |
| 65 |
. |
| 66 |
<link linkend="inletf"><citetitle>inletf</citetitle></link>, for |
| 67 |
receiving an frate signal through a named port. |
| 68 |
|
| 69 |
<link linkend="inletv"><citetitle>inletv</citetitle></link>, for |
| 70 |
receiving an arate array signal through a named port. |
| 71 |
|
| 72 |
<link linkend="connect"><citetitle>connect</citetitle></link>, for |
| 73 |
routing the signal from a named outlet in a source instrument |
| 74 |
to a named inlet in a sink instrument. |
| 75 |
|
| 76 |
<link linkend="alwayson"><citetitle>alwayson</citetitle></link> for |
| 77 |
permanently activating an instrument from the orchestra header, |
| 78 |
without need of a score statement, e.g. for use as an effect processor |
| 79 |
receiving inputs from a number of sources. |
| 80 |
|
| 81 |
<link linkend="ftgenonce"><citetitle>ftgenonce</citetitle></link> for |
| 82 |
instantiating function tables from within instrument definitions, without |
| 83 |
need for f-statements in the score or ftgen opcodes in the orchestra header. |
| 84 |
</para> |
| 85 |
|
| 86 |
<para> |
| 87 |
A typical scenario for the use of these opcodes would be something like this. |
| 88 |
A set of instruments would be defined, each in its own orchestra file, and |
| 89 |
each instrument would define inlet ports, outlet ports, and function tables within itself. Such |
| 90 |
instruments are completely self-contained. Then, a set of effects processors, such |
| 91 |
as equalizers, reverbs, compressors, and so on, would also be defined, each in its |
| 92 |
own file. Then, a customized master orchestra would #include the instruments |
| 93 |
and effects to be used, route the outputs of some instruments into one equalizer |
| 94 |
and the outputs of other effects into another equalizer, then route the outputs of |
| 95 |
both equalizers into a reverb, the output of the reverb into a compressor, and |
| 96 |
the output of the compressor into a stereo output soundfile. |
| 97 |
</para> |
| 98 |
|
| 99 |
<refsect1> |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
<title>Example</title> |
| 104 |
<para> |
| 105 |
Here is an example of the signal flow graph opcodes. It uses the file <ulink url="examples/signalflowgraph.csd"><citetitle>signalflowgraph.csd</citetitle></ulink>. |
| 106 |
<example> |
| 107 |
<title>Example of the signal flow graph opcodes.</title> |
| 108 |
<xi:include href="examples-xml/signalflowgraph.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 109 |
</example> |
| 110 |
</para> |
| 111 |
</refsect1> |
| 112 |
|
| 113 |
</chapter> |