Sophie

Sophie

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

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>tab</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="tb.html" title="tb" />
    <link rel="next" href="tabrec.html" title="tabrec" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">tab</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="tb.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="tabrec.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="tab">
      <a id="tab"></a>
      <div class="titlepage"></div>
      <a id="IndexTabw_i" class="indexterm"></a>
      <a id="IndexTabw" class="indexterm"></a>
      <a id="IndexTab_i" class="indexterm"></a>
      <a id="IndexTab" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">tab</span>
        </h2>
        <p>tab — 
      Fast table opcodes.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp47178224"></a>
        <h2>Description</h2>
        <p>
      Fast table opcodes. Faster than
    <a class="link" href="table.html" title="table"><em class="citetitle">table</em></a> and
    <a class="link" href="tablew.html" title="tablew"><em class="citetitle">tablew</em></a> because don't
    allow wrap-around and limit and don't check index validity. Have
    been implemented in order to provide fast access to
    arrays. Support non-power of two tables (can be generated by any
    GEN function by giving a negative length value). 
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp47180080"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ir <span class="command"><strong>tab_i</strong></span> indx, ifn[, ixmode]</pre>
        <pre class="synopsis">kr <span class="command"><strong>tab</strong></span> kndx, ifn[, ixmode]</pre>
        <pre class="synopsis">ar <span class="command"><strong>tab</strong></span> xndx, ifn[, ixmode]</pre>
        <pre class="synopsis"><span class="command"><strong>tabw_i</strong></span> isig, indx, ifn [,ixmode]</pre>
        <pre class="synopsis"><span class="command"><strong>tabw</strong></span> ksig, kndx, ifn [,ixmode]</pre>
        <pre class="synopsis"><span class="command"><strong>tabw</strong></span> asig, andx, ifn [,ixmode]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp47184528"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifn</em></span> -- table number
    </p>
        <p>
      <span class="emphasis"><em>ixmode</em></span> -- defaults to zero.  If zero
      <span class="emphasis"><em>xndx</em></span> and <span class="emphasis"><em>ixoff</em></span> ranges match the
      length of the table; if non zero <span class="emphasis"><em>xndx</em></span> and
      <span class="emphasis"><em>ixoff</em></span> have a 0 to 1 range. 
    </p>
        <p>
      <span class="emphasis"><em>isig</em></span> -- input value to write.
    </p>
        <p>
      <span class="emphasis"><em>indx</em></span> -- table index
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp47187632"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>asig, ksig</em></span> -- input signal to write.
    </p>
        <p>
      <span class="emphasis"><em>andx, kndx</em></span> -- table index.
    </p>
        <p>
      <span class="emphasis"><em>tab</em></span> and <span class="emphasis"><em>tabw</em></span>
      opcodes are similar to <span class="emphasis"><em>table</em></span> and
      <span class="emphasis"><em>tablew</em></span>, but are faster and support tables
      having non-power-of-two length. 
    </p>
        <p>
      Special care of index value must be taken into account. Index
      values out of the table allocated space will crash Csound. 
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp47190408"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the tab opcode. It uses the file <a class="ulink" href="examples/tab.csd" target="_top"><em class="citetitle">tab.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp47191376"></a>
          <p class="title">
            <strong>Example 846. Example of the tab 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 tab.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

gifn1 <span class="ohdr">ftgen</span> 1, 0, 0, 1, "flute.aiff", 0, 4, 0	<span class="comment">;deferred-size table</span>

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

atab  <span class="opc">init</span> 0 
isize <span class="opc">tableng</span> 1					<span class="comment">;length of table?</span>
<span class="opc">print</span> isize
andx  <span class="opc">phasor</span> 1 <span class="op">/</span> (isize <span class="op">/</span> sr) 
asig  <span class="opc">tab</span> andx, 1, 1				<span class="comment">;has a 0 to 1 range</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 2.3
<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="Credits">
        <a id="idp47193640"></a>
        <h2>Credits</h2>
        <p>Written by Gabriel Maldonado.</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="tb.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="tabrec.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">tb </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> tabrec</td>
        </tr>
      </table>
    </div>
  </body>
</html>