| 1 | |
| 2 | <refentry id="clear"> |
| 3 | <indexterm id="IndexClear"><primary>clear</primary></indexterm> |
| 4 | <refentryinfo><title>Mathematical Operations:Comparators and Accumulators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>clear</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>clear</refname> |
| 11 | <refpurpose> |
| 12 | Zeroes a list of audio signals. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | <emphasis>clear</emphasis> zeroes a list of audio signals. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis><command>clear</command> avar1 [, avar2] [, avar3] [...]</synopsis> |
| 26 | <synopsis><command>clear</command> avar[]</synopsis> |
| 27 | </refsect1> |
| 28 | |
| 29 | <refsect1> |
| 30 | <title>Performance</title> |
| 31 | <para> |
| 32 | <emphasis>avar1, avar2, avar3,</emphasis> ... -- signals to be zeroed |
| 33 | </para> |
| 34 | <para> |
| 35 | <emphasis>avar[]</emphasis> -- array of signals to be cleared. |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis>kvar[]</emphasis> ... -- array of k-values to be cleared. |
| 39 | </para> |
| 40 | |
| 41 | <para><note>Before version 6.13 this opcode was not compatible with multicore |
| 42 | operations if used with a global variable.</note></para> |
| 43 | <para> |
| 44 | <emphasis>clear</emphasis> sets every sample of each of the given audio signals to zero when it is performed. This is equivalent to writing <emphasis>avarN = 0</emphasis> in the orchestra for each of the specified variables. Typically, <emphasis>clear</emphasis> is used with global variables that combine multiple signals from different sources and change with each k-pass (performance loop) through all of the active instrument instances. After the final usage of such a variable and before the next k-pass, it is necessary to clear the variable so that it does not add the next cycle's signals to the previous result. <emphasis>clear</emphasis> is especially useful in combination with <link linkend="vincr"><citetitle>vincr</citetitle></link> (variable increment) and they are intended to be used together with file output opcodes such as <link linkend="fout"><citetitle>fout</citetitle></link>. |
| 45 | </para> |
| 46 | </refsect1> |
| 47 | |
| 48 | <refsect1> |
| 49 | <title>Examples</title> |
| 50 | <para> |
| 51 | Here is an example of the clear opcode. It uses the file <ulink url="examples/clear.csd"><citetitle>clear.csd</citetitle></ulink>. |
| 52 | |
| 53 | <example> |
| 54 | <title>Example of the clear opcode.</title> |
| 55 | |
| 56 | |
| 57 | |
| 58 | <xi:include href="examples-xml/clear.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 59 | </example> |
| 60 | </para> |
| 61 | <para> |
| 62 | See the <link linkend="fout"><citetitle>fout</citetitle></link> opcode for another example. |
| 63 | </para> |
| 64 | </refsect1> |
| 65 | |
| 66 | <refsect1> |
| 67 | <title>See also</title> |
| 68 | <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para> |
| 69 | <para><link linkend="SigmodCompaccum"><citetitle>Comparators and Accumulators</citetitle></link></para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Credits</title> |
| 74 | <para> |
| 75 | <simplelist> |
| 76 | <member>Author: &namegabriel;</member> |
| 77 | <member>Italy</member> |
| 78 | <member>1999</member> |
| 79 | <member>Author: &namevictor;</member> |
| 80 | </simplelist> |
| 81 | </para> |
| 82 | |
| 83 | <para>New in Csound version 3.56</para> |
| 84 | <para>Revised in Csound version 6.17 for arrays</para> |
| 85 | </refsect1> |
| 86 | </refentry> |