| 1 | |
| 2 | <refentry id="table"> |
| 3 | <indexterm id="IndexTable"><primary>table</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Table Access</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>table</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>table</refname> |
| 11 | <refpurpose> |
| 12 | Accesses table values by direct indexing. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Accesses table values by direct indexing. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>ares <command>table</command> andx, ifn [, ixmode] [, ixoff] [, iwrap]</synopsis> |
| 26 | |
| 27 | <synopsis>ires <command>table</command> indx, ifn [, ixmode] [, ixoff] [, iwrap]</synopsis> |
| 28 | |
| 29 | <synopsis>kres <command>table</command> kndx, ifn [, ixmode] [, ixoff] [, iwrap]</synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Initialization</title> |
| 34 | <para> |
| 35 | <emphasis>ifn</emphasis> -- function table number. |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | <emphasis>ixmode</emphasis> (optional) -- index data mode. The default value is 0. |
| 40 | <itemizedlist> |
| 41 | <listitem><para>0 = raw index</para></listitem> |
| 42 | <listitem><para>1 = normalized (0 to 1)</para></listitem> |
| 43 | </itemizedlist> |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | <emphasis>ixoff</emphasis> (optional) -- amount by which index is to be offset. For a table with origin at center, use tablesize/2 (raw) or .5 (normalized). The default value is 0. |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | <emphasis>iwrap</emphasis> (optional) -- wraparound index flag. The default value is 0. |
| 52 | <itemizedlist> |
| 53 | <listitem> |
| 54 | <para>0 = nowrap (index < 0 treated as index=0; index > tablesize sticks at index=size)</para> |
| 55 | </listitem> |
| 56 | |
| 57 | <listitem> |
| 58 | <para>1 = wraparound.</para> |
| 59 | </listitem> |
| 60 | </itemizedlist> |
| 61 | </para> |
| 62 | </refsect1> |
| 63 | |
| 64 | <refsect1> |
| 65 | <title>Performance</title> |
| 66 | <para> |
| 67 | <emphasis>table</emphasis> invokes table lookup on behalf of init, control or audio indices. These indices can be raw entry numbers (0,l,2...size - 1) or scaled values (0 to 1-e). Indices are first modified by the offset value then checked for range before table lookup (see <emphasis>iwrap</emphasis>). If index is likely to be full scale, or if interpolation is being used, the table should have an extended guard point. <emphasis>table</emphasis> indexed by a periodic phasor ( see <link linkend="phasor"><citetitle>phasor</citetitle></link>) will simulate an oscillator. |
| 68 | </para> |
| 69 | </refsect1> |
| 70 | |
| 71 | <refsect1> |
| 72 | <title>Examples</title> |
| 73 | <para> |
| 74 | Here is an example of the table opcode. It uses the file <ulink url="examples/table.csd"><citetitle>table.csd</citetitle></ulink>. |
| 75 | |
| 76 | <example> |
| 77 | <title>Example of the table opcode.</title> |
| 78 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 79 | <xi:include href="examples-xml/table.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 80 | </example> |
| 81 | </para> |
| 82 | </refsect1> |
| 83 | |
| 84 | <refsect1> |
| 85 | <title>See Also</title> |
| 86 | <para><link linkend="SiggenTableacc"><citetitle>Table Access</citetitle></link></para> |
| 87 | <para> More information on this opcode: <ulink url="http://www.csoundjournal.com/issue12/genInstruments.html"><citetitle>http://www.csoundjournal.com/issue12/genInstruments.html</citetitle></ulink> , written by Jacob Joaquin </para> |
| 88 | </refsect1> |
| 89 | |
| 90 | </refentry> |