Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > b707d9a4ee443103660a75ccb6e51334 > files > 2211

csound-doc-5.19.01-10.mga5.noarch.rpm

<?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>minaccum</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" />
    <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="minabsaccum.html" title="minabsaccum" />
    <link rel="next" href="mincer.html" title="mincer" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">minaccum</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="minabsaccum.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="mincer.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="minaccum">
      <a id="minaccum"></a>
      <div class="titlepage"></div>
      <a id="IndexMinaccum" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">minaccum</span>
        </h2>
        <p>minaccum — 
      Accumulates the minimum value of audio signals.
          </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp31674216"></a>
        <h2>Description</h2>
        <p>
      <span class="emphasis"><em>minaccum</em></span> compares two audio-rate variables and stores the minimum value between them into the first.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp31661280"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>minaccum</strong></span> aAccumulator, aInput</pre>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp31662304"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>aAccumulator</em></span> -- audio variable to store the minimum value
    </p>
        <p>
      <span class="emphasis"><em>aInput</em></span> -- signal that aAccumulator is compared to
    </p>
        <p>
      The <span class="emphasis"><em>minaccum</em></span> opcode is designed to accumulate the minimum value from among many audio signals that may be in different note instances, different channels, or otherwise cannot all be compared at once using the <span class="emphasis"><em>min</em></span> opcode.  Its semantics are similar to <span class="emphasis"><em>vincr</em></span> since <span class="emphasis"><em>aAccumulator</em></span> is used as both an input and an output variable, except that <span class="emphasis"><em>minaccum</em></span> keeps the minimum value instead of adding the signals together.  <span class="emphasis"><em>minaccum</em></span> performs the following operation on each pair of samples:
    </p>
        <p>
      </p>
        <div class="literallayout">
          <p><br />
            if  (aInput &lt; aAccumulator)  aAccumulator = aInput<br />
      </p>
        </div>
        <p>
    </p>
        <p>
      <span class="emphasis"><em>aAccumulator</em></span> will usually be a global audio variable.  At the end of any given computation cycle (k-period), after its value is read and used in some way, the accumulator variable should usually be reset to some large enough positive value that will always be greater than the input signals to which it is compared.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp31714224"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the minaccum opcode. It uses the file <a class="ulink" href="examples/minaccum.csd" target="_top"><em class="citetitle">minaccum.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp31715208"></a>
          <p class="title">
            <strong>Example 478. Example of the minaccum opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac   <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o minaccum.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

<span class="oblock">instr</span> 1	<span class="comment">;saw</span>

asig  <span class="opc">vco2</span> .2, p4		
      <span class="opc">outs</span>  asig, asig				
gasaw <span class="op">=</span> asig
<span class="oblock">endin</span>

<span class="oblock">instr</span> 2	<span class="comment">;sine</span>

aout  <span class="opc">poscil</span> .3, p4, 1		
      <span class="opc">outs</span>  aout, aout				
gasin <span class="op">=</span> aout
<span class="oblock">endin</span>

<span class="oblock">instr</span> 10

accum <span class="opc">init</span> 0	
      <span class="opc">minaccum</span> accum, gasaw <span class="op">+</span> gasin		<span class="comment">;saw and sine accumulated		</span>
      <span class="opc">outs</span>  accum, accum
     		
<span class="opc">clear</span> accum
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span> 1 0 4096 10 1	

<span class="stamnt">i</span> 1 0 7 330
<span class="stamnt">i</span> 2 3 3 440

<span class="stamnt">i</span> 1 10 7 330	<span class="comment">;same notes but without minaccum, for comparison</span>
<span class="stamnt">i</span> 2 13 3 440

<span class="stamnt">i</span> 10 0 6	<span class="comment">;accumulation note stops after 6 seconds</span>

<span class="stamnt">e</span>

<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1" title="See Also">
        <a id="idp31717488"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="maxaccum.html" title="maxaccum"><em class="citetitle">maxaccum</em></a>,
      <a class="link" href="maxabsaccum.html" title="maxabsaccum"><em class="citetitle">maxabsaccum</em></a>,
      <a class="link" href="minabsaccum.html" title="minabsaccum"><em class="citetitle">minabsaccum</em></a>,
      <a class="link" href="max.html" title="max"><em class="citetitle">max</em></a>,
      <a class="link" href="min.html" title="min"><em class="citetitle">min</em></a>,
      <a class="link" href="maxabs.html" title="maxabs"><em class="citetitle">maxabs</em></a>,
      <a class="link" href="minabs.html" title="minabs"><em class="citetitle">minabs</em></a>,
      <a class="link" href="vincr.html" title="vincr"><em class="citetitle">vincr</em></a>
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp31721800"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Anthony Kozar</td>
          </tr>
          <tr>
            <td>March 2006</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in Csound version 5.01</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="minabsaccum.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="mincer.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">minabsaccum </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> mincer</td>
        </tr>
      </table>
    </div>
  </body>
</html>