<?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" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <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="id3274261"></a> <h2>Description</h2> <p> Mixes two tables. </p> </div> <div class="refsect1" title="Syntax"> <a id="id3274272"></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="id3274290"></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="See Also"> <a id="id3275275"></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="id3275324"></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>