| 1 | |
| 2 | <refentry id="vincr"> |
| 3 | <indexterm id="IndexVincr"><primary>vincr</primary></indexterm> |
| 4 | <refentryinfo><title>Mathematical Operations:Comparators and Accumulators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>vincr</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>vincr</refname> |
| 11 | <refpurpose> |
| 12 | Accumulates audio signals. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | <emphasis>vincr</emphasis> increments one audio variable with another signal, i.e. it accumulates output. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis><command>vincr</command> accum, aincr</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Performance</title> |
| 30 | <para> |
| 31 | <emphasis>accum</emphasis> -- audio-rate accumulator variable to be incremented |
| 32 | </para> |
| 33 | |
| 34 | <para> |
| 35 | <emphasis>aincr</emphasis> -- incrementing signal |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | <emphasis>vincr</emphasis> (variable increment) and <link linkend="clear"><citetitle>clear</citetitle></link> are intended to be used together. <emphasis>vincr</emphasis> stores the result of the sum of two audio variables into the first variable itself (which is intended to be used as an accumulator in polyphony). The accumulator is typically a global variable that is used to combine signals from several sources (different instruments or instrument instances) for further processing (for example, via a global effect that reads the accumulator) or for outputting the combined signal by some means other than one of the <emphasis>out</emphasis> opcodes (eg. via the <link linkend="fout"><citetitle>fout</citetitle></link> opcode). After the accumulator is used, the accumulator variable should be set to zero by means of the <emphasis>clear</emphasis> opcode (or it will explode). |
| 40 | </para> |
| 41 | </refsect1> |
| 42 | |
| 43 | <refsect1> |
| 44 | <title>Examples</title> |
| 45 | <para> |
| 46 | The following example uses the vincr opcode. It uses the file <ulink url="examples/vincr.csd"><citetitle>vincr.csd</citetitle></ulink>. |
| 47 | <example> |
| 48 | <title>Example of the vincr opcode.</title> |
| 49 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 50 | <xi:include href="examples-xml/vincr.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 51 | </example> |
| 52 | This is another example uses the vincr opcode. It uses the file <ulink url="examples/vincr-complex.csd"><citetitle>vincr-complex.csd</citetitle></ulink>. |
| 53 | <example> |
| 54 | <xi:include href="examples-xml/vincr-complex.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 55 | </example> |
| 56 | </para> |
| 57 | </refsect1> |
| 58 | |
| 59 | <refsect1> |
| 60 | <title>See also</title> |
| 61 | <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para> |
| 62 | <para><link linkend="SigmodCompaccum"><citetitle>Comparators and Accumulators</citetitle></link></para> |
| 63 | </refsect1> |
| 64 | |
| 65 | <refsect1> |
| 66 | <title>Credits</title> |
| 67 | <para> |
| 68 | <simplelist> |
| 69 | <member>Author: &namegabriel;</member> |
| 70 | <member>Italy</member> |
| 71 | <member>1999</member> |
| 72 | </simplelist> |
| 73 | </para> |
| 74 | |
| 75 | <para>New in Csound version 3.56</para> |
| 76 | </refsect1> |
| 77 | </refentry> |