Sophie

Sophie

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

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>vtablek</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="vtablei.html" title="vtablei" />
    <link rel="next" href="vtablea.html" title="vtablea" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">vtablek</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="vtablei.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="vtablea.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="vtablek">
      <a id="vtablek"></a>
      <div class="titlepage"></div>
      <a id="IndexVtablek" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">vtablek</span>
        </h2>
        <p>vtablek — 
     Read vectors (from tables -or arrays of vectors).
      
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp53285056"></a>
        <h2>Description</h2>
        <p>
	This opcode reads vectors from tables at k-rate.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp53285768"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>vtablek</strong></span>  kndx, kfn, kinterp, ixmode, kout1 [, kout2, kout3, .... , koutN ]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp53296232"></a>
        <h2>Initialization</h2>
        <p> <span class="emphasis"><em>ixmode</em></span> -  index data mode. The default value is 0.
    </p>
        <p>                == 0 index is treated as a raw table location,
      </p>
        <p>                == 1 index is normalized (0 to 1).
      </p>
        <p>
      <span class="emphasis"><em>kinterp</em></span> - switch beetween interpolated or non-interpolated output. 0 -&gt; non-interpolation , non-zero -&gt; interpolation activated
      </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp53298344"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kndx</em></span> - Index into f-table, either a positive number range matching the table length (ixmode = 0) or a 0 to 1 range (ixmode != 0).
     </p>
        <p>
      <span class="emphasis"><em>kfn</em></span> - table number
     </p>
        <p>
      <span class="emphasis"><em>kout1...koutN</em></span> - output vector elements
    </p>
        <p>
      This opcode is useful in all cases in which one needs to access sets of values associated to unique indexes (for example, multi-channel samples, STFT bin frames, spectral formants, p-field based scores etc.). The number of elements of each vector (length of the vector) is determined by the number of optional arguments on the right (kout1 , kout2, kout3, ....  koutN).
    </p>
        <p>
      <span class="emphasis"><em>vtablek</em></span> allows the user to switch beetween interpolated or non-interpolated output at k-rate by means of kinterp argument.
    </p>
        <p>
      <span class="emphasis"><em>vtablek</em></span> allows also to switch the table number at k-rate (but this is possible only when vector frames of each used table have the same number of elements, otherwise unpredictable results could occurr), as well as to choose indexing style (raw or normalized, see  also ixmode argument of table opcode ).
    </p>
        <p>
      Notice that no wrap nor limit mode is implemented.  So, if  an index attempt to access to a zone not allocated by the table, Csound will probably crash. However this drawback can be easily avoided by using wrap or limit opcodes applied to indexes before using vtable, in order to correct eventual out-of-range values.
    </p>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
        Notice that <span class="emphasis"><em>vtablek</em></span>'s output arguments are placed at the left of the opcode name, differently from usual (this style is already used in other opcodes using undefined lists of output arguments such as <a class="link" href="fin.html" title="fin"><em class="citetitle">fin</em></a> or <a class="link" href="trigseq.html" title="trigseq"><em class="citetitle">trigseq</em></a>).
      </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp53368664"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the vtablek opcode. It uses the files <a class="ulink" href="examples/vtablek.csd" target="_top"><em class="citetitle">vtablek.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp53369648"></a>
          <p class="title">
            <strong>Example 983. Example of the vtablek opcode.</strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
-odac -B441 -b441
<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">kr</span>     <span class="op">=</span>        100
<span class="ohdr">ksmps</span>  <span class="op">=</span>        441
<span class="ohdr">nchnls</span> <span class="op">=</span>        2

gkindx <span class="opc">init</span> <span class="op">-</span>1

       <span class="oblock">instr</span>    1
kindex <span class="opc">init</span> 0
ktrig <span class="opc">metro</span> 0.5
<span class="octrl">if</span> ktrig <span class="op">=</span> 0 <span class="octrl">goto</span> <span class="olabel">noevent</span>
gkindx <span class="op">=</span> gkindx <span class="op">+</span> 1
<span class="olabel">noevent</span><span class="op">:</span>

	<span class="oblock">endin</span>

	<span class="oblock">instr</span>	2
kout1 <span class="opc">init</span> 0
kout2 <span class="opc">init</span> 0
kout3 <span class="opc">init</span> 0
kout4 <span class="opc">init</span> 0
<span class="opc">vtablek</span>  gkindx, 1, 1, 0, kout1,kout2, kout3, kout4
<span class="opc">printk2</span> kout1
<span class="opc">printk2</span> kout2
<span class="opc">printk2</span> kout3
<span class="opc">printk2</span> kout4
	<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 32 10 1
<span class="stamnt">i</span> 1 0 20
<span class="stamnt">i</span> 2 0 20
<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="idp53370680"></a>
        <h2>See also</h2>
        <p>
      <a class="link" href="vtablea.html" title="vtablea"><em class="citetitle">vtablea</em></a>,
      <a class="link" href="vtablei.html" title="vtablei"><em class="citetitle">vtablei</em></a>,
      <a class="link" href="vtabk.html" title="vtabk"><em class="citetitle">vtabk</em></a>,
      <a class="link" href="vtablewk.html" title="vtablewk"><em class="citetitle">vtablewk</em></a>,
      <a class="link" href="vtabwk.html" title="vtabwk"><em class="citetitle">vtabwk</em></a>,
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp53373704"></a>
        <h2>Credits</h2>
        <p>Written by Gabriel Maldonado.</p>
        <p>Example written by Andres Cabrera.</p>
        <p>New in Csound 5 (Previously available only on CsoundAV)</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="vtablei.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="vtablea.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">vtablei </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> vtablea</td>
        </tr>
      </table>
    </div>
  </body>
</html>