Sophie

Sophie

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

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>tablemix</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="tablekt.html" title="tablekt" />
    <link rel="next" href="tableng.html" title="tableng" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">tablemix</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="tablekt.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="tableng.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="tablemix">
      <a id="tablemix"></a>
      <div class="titlepage"></div>
      <a id="IndexTablemix" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">tablemix</span>
        </h2>
        <p>tablemix — 
      Mixes two tables.
          </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp47657312"></a>
        <h2>Description</h2>
        <p>
      Mixes two tables.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp47657944"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>tablemix</strong></span> kdft, kdoff, klen, ks1ft, ks1off, ks1g, ks2ft, ks2off, ks2g</pre>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp47661432"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kdft</em></span> -- Destination function table.
    </p>
        <p>
      <span class="emphasis"><em>kdoff</em></span> -- Offset to start writing from. Can be negative.
    </p>
        <p>
      <span class="emphasis"><em>klen</em></span> -- Number of write operations to perform. Negative means work backwards.
    </p>
        <p>
      <span class="emphasis"><em>ks1ft</em></span>, <span class="emphasis"><em>ks2ft</em></span> -- Source function tables. These can be the same as the destination table, if care is exercised about direction of copying data.
    </p>
        <p>
      <span class="emphasis"><em>ks1off</em></span>, <span class="emphasis"><em>ks2off</em></span> -- Offsets to start reading from in source tables.
    </p>
        <p>
      <span class="emphasis"><em>ks1g</em></span>, <span class="emphasis"><em>ks2g</em></span> -- Gains to apply when reading from the source tables. The results are added and the sum is written to the destination table.
    </p>
        <p>
      <span class="emphasis"><em>tablemix</em></span> -- This opcode mixes from two tables, with separate gains into the destination table. Writing is done for <span class="emphasis"><em>klen</em></span> locations, usually stepping forward through the table - if <span class="emphasis"><em>klen</em></span> is positive. If it is negative, then the writing and reading order is backwards - towards lower indexes in the tables. This bi-directional option makes it easy to shift the contents of a table sideways by reading from it and writing back to it with a different offset.
    </p>
        <p>
      If <span class="emphasis"><em>klen</em></span> is 0, no writing occurs. Note that the internal integer value of <span class="emphasis"><em>klen</em></span> is derived from the ANSI C floor() function - which returns the next most negative integer. Hence a fractional negative <span class="emphasis"><em>klen</em></span> value of -2.3 would create an internal length of 3, and cause the copying to start from the offset locations and proceed for two locations to the left.
    </p>
        <p>
      The total index for table reading and writing is calculated from the starting offset for each table, plus the index value, which starts at 0 and then increments (or decrements) by 1 as mixing proceeds.
    </p>
        <p>
      These total indexes can potentially be very large, since there is no restriction on the offset or the <span class="emphasis"><em>klen</em></span>. However each total index for each table is ANDed with a length mask (such as 0000 0111 for a table of length 8) to form a final index which is actually used for reading or writing. So no reading or writing can occur outside the tables. This is the same as <span class="quote">“<span class="quote">wrap</span>”</span> mode in table read and write. These opcodes do not read or write the guardpoint. If a table has been rewritten with one of these, then if it has a guardpoint which is supposed to contain the same value as the location 0, then call <a class="link" href="tablegpw.html" title="tablegpw"><em class="citetitle">tablegpw</em></a> afterwards.
    </p>
        <p>
      The indexes and offsets are all in table steps - they are not normalized to 0 - 1. So for a table of length 256, <span class="emphasis"><em>klen</em></span> should be set to 256 if all the table was to be read or written.
    </p>
        <p>
      The tables do not need to be the same length - wrapping occurs individually for each table.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp47724296"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the tablemix opcode. It uses the file <a class="ulink" href="examples/tablemix.csd" target="_top"><em class="citetitle">tablemix.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp47725280"></a>
          <p class="title">
            <strong>Example 856. Example of the tablemix 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 tablemix.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

gisinoid <span class="ohdr">ftgen</span> 1, 0, 256, 10, 1, 0, 0, .4		<span class="comment">;sinoid</span>
gisaw    <span class="ohdr">ftgen</span> 2, 0, 1024, 7, 0, 256, 1			<span class="comment">;saw</span>
gimix    <span class="ohdr">ftgen</span> 100, 0, 256, 7, 0, 256, 1		<span class="comment">;destination table</span>

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

kgain <span class="opc">linseg</span> 0, p3<span class="op">*</span>.5, .5, p3<span class="op">*</span>.5, 0
      <span class="opc">tablemix</span> 100, 0, 256, 1, 0, 1, 2, 0, kgain
asig  <span class="opc">poscil</span> .5, 110, gimix			<span class="comment">;mix table 1 &amp; 2			</span>
      <span class="opc">outs</span>   asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span>1 0 10

<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="idp47727560"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="tablecopy.html" title="tablecopy"><em class="citetitle">tablecopy</em></a>,
      <a class="link" href="tablegpw.html" title="tablegpw"><em class="citetitle">tablegpw</em></a>,
      <a class="link" href="tableicopy.html" title="tableicopy"><em class="citetitle">tableicopy</em></a>,
      <a class="link" href="tableigpw.html" title="tableigpw"><em class="citetitle">tableigpw</em></a>,
      <a class="link" href="tableimix.html" title="tableimix"><em class="citetitle">tableimix</em></a>
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp47730496"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Robin Whittle</td>
          </tr>
          <tr>
            <td>Australia</td>
          </tr>
          <tr>
            <td>May 1997</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in version 3.47</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="tablekt.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="tableng.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">tablekt </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> tableng</td>
        </tr>
      </table>
    </div>
  </body>
</html>