<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>clear</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <link rel="stylesheet" type="text/css" href="syntax-highlighting.css" /> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="ckgoto.html" title="ckgoto" /> <link rel="next" href="clfilt.html" title="clfilt" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">clear</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="ckgoto.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="clfilt.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="clear"></a> <div class="titlepage"></div> <a id="IndexClear" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">clear</span> </h2> <p>clear — Zeroes a list of audio signals. </p> </div> <div class="refsect1"> <a id="idm281472946591176"></a> <h2>Description</h2> <p> <span class="emphasis"><em>clear</em></span> zeroes a list of audio signals. </p> </div> <div class="refsect1"> <a id="idm281472946587544"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>clear</strong></span> avar1 [, avar2] [, avar3] [...]</pre> </div> <div class="refsect1"> <a id="idm281472946585480"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>avar1, avar2, avar3,</em></span> ... -- signals to be zeroed </p> <p> <span class="emphasis"><em>clear</em></span> sets every sample of each of the given audio signals to zero when it is performed. This is equivalent to writing <span class="emphasis"><em>avarN = 0</em></span> in the orchestra for each of the specified variables. Typically, <span class="emphasis"><em>clear</em></span> 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. <span class="emphasis"><em>clear</em></span> is especially useful in combination with <a class="link" href="vincr.html" title="vincr"><em class="citetitle">vincr</em></a> (variable increment) and they are intended to be used together with file output opcodes such as <a class="link" href="fout.html" title="fout"><em class="citetitle">fout</em></a>. </p> </div> <div class="refsect1"> <a id="idm281472946517208"></a> <h2>Examples</h2> <p> Here is an example of the clear opcode. It uses the file <a class="ulink" href="examples/clear.csd" target="_top"><em class="citetitle">clear.csd</em></a>. </p> <div class="example"> <a id="idm281472946515352"></a> <p class="title"> <strong>Example 129. Example of the clear opcode.</strong> </p> <div class="example-contents"> <div class="refsect1"> <a id="idm281472780809736"></a> <pre class="programlisting"> <span class="nt"><CsoundSynthesizer></span> <span class="nt"><CsOptions></span> <span class="c1">; Select audio/midi flags here according to platform</span> -odac <span class="c1">;;;realtime audio out</span> <span class="c1">;-iadc ;;;uncomment -iadc if RT audio input is needed too</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o clear.wav -W ;;; for file output any platform</span> <span class="nt"></CsOptions></span> <span class="nt"><CsInstruments></span> <span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span> <span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">32</span> <span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">2</span> <span class="vg">0dbfs</span> <span class="o">=</span> <span class="mi">1</span> ga<span class="n">Reverb</span> <span class="nb">init</span> <span class="mi">0</span> <span class="kd">instr</span> <span class="nf">1</span> i<span class="n">dur</span> <span class="o">=</span> <span class="nb">p3</span> k<span class="n">pitch</span> <span class="o">=</span> <span class="nb">p4</span> a<span class="n">1</span> <span class="nb">diskin2</span> <span class="s">"fox.wav"</span><span class="p">,</span> k<span class="n">pitch</span> a<span class="n">1</span> <span class="o">=</span> a<span class="n">1</span><span class="o">*</span><span class="mf">.5</span> <span class="c1">;reduce volume</span> <span class="nb">vincr</span> ga<span class="n">Reverb</span><span class="p">,</span> a<span class="n">1</span> <span class="kd">endin</span> <span class="kd">instr</span> <span class="nf">99</span> <span class="c1">; global reverb </span> a<span class="n">l</span><span class="p">,</span> a<span class="n">r</span> <span class="nb">reverbsc</span> ga<span class="n">Reverb</span><span class="p">,</span> ga<span class="n">Reverb</span><span class="p">,</span> <span class="mf">.8</span><span class="p">,</span> <span class="mi">10000</span> <span class="nb">outs</span> ga<span class="n">Reverb</span><span class="o">+</span>a<span class="n">l</span><span class="p">,</span> ga<span class="n">Reverb</span><span class="o">+</span>a<span class="n">r</span> <span class="nb">clear</span> ga<span class="n">Reverb</span> <span class="kd">endin</span> <span class="nt"></CsInstruments></span> <span class="nt"><CsScore></span> <span class="nb">i</span><span class="mi">1</span> <span class="mi">0</span> <span class="mi">3</span> <span class="mi">1</span> <span class="nb">i</span><span class="mi">99</span> <span class="mi">0</span> <span class="mi">5</span> <span class="nb">e</span> <span class="nt"></CsScore></span> <span class="nt"></CsoundSynthesizer></span> </pre> </div> </div> </div> <p><br class="example-break" /> </p> <p> See the <a class="link" href="fout.html" title="fout"><em class="citetitle">fout</em></a> opcode for another example. </p> </div> <div class="refsect1"> <a id="idm281472946512200"></a> <h2>See Also</h2> <p> <a class="link" href="vincr.html" title="vincr"><em class="citetitle">vincr</em></a> </p> </div> <div class="refsect1"> <a id="idm281472946510088"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Gabriel Maldonado</td> </tr> <tr> <td>Italy</td> </tr> <tr> <td>1999</td> </tr> </table> <p> </p> <p>New in Csound version 3.56</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="ckgoto.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="clfilt.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">ckgoto </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> clfilt</td> </tr> </table> </div> </body> </html>