Debian Codegraph @

opcodes/tablei.xml

raw symbols SCIP
1
2 <refentry id="tablei">
3 <indexterm id="IndexTablei"><primary>tablei</primary></indexterm>
4 <refentryinfo><title>Signal Generators:Table Access</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>tablei</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>tablei</refname>
11 <refpurpose>
12 Accesses table values by direct indexing with linear interpolation.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Accesses table values by direct indexing with linear interpolation.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>ares <command>tablei</command> andx, ifn [, ixmode] [, ixoff] [, iwrap]</synopsis>
26
27 <synopsis>ires <command>tablei</command> indx, ifn [, ixmode] [, ixoff] [, iwrap]</synopsis>
28
29 <synopsis>kres <command>tablei</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. <emphasis>tablei</emphasis> requires the extended guard point.
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 &lt; 0 treated as index=0; index &gt; 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>tablei</emphasis> is a interpolating unit in which the fractional part of index is used to interpolate between adjacent table entries. The smoothness gained by interpolation is at some small cost in execution time (see also <link linkend="oscili"><citetitle>oscili</citetitle></link>, etc.), but the interpolating and non-interpolating units are otherwise interchangeable. Note that when <emphasis>tablei</emphasis> uses a periodic index whose modulo <emphasis>n</emphasis> is less than the power of 2 table length, the interpolation process requires that there be an (<emphasis>n</emphasis> + 1)th table value that is a repeat of the 1st (see <link linkend="f"><citetitle>f Statement</citetitle></link> in score).
68 </para>
69 <para>
70 <warning>
71 Reading tables which contain stereo- or multichannel-information
72 probably causes unwanted noise as the opcode interpolates between
73 subsequent positions of the table regardless of the origin of its
74 content. Usually just the content of one channel is expected
75 Consider using <emphasis>loscilx</emphasis> instead.
76 b </warning>
77 </para>
78 </refsect1>
79
80 <refsect1>
81 <title>Examples</title>
82 <para>
83 Here is an example of the tablei opcode. It uses the file <ulink url="examples/tablei.csd"><citetitle>tablei.csd</citetitle></ulink>.
84 <example>
85 <title>Example of the tablei opcode.</title>
86 <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>
87 <xi:include href="examples-xml/tablei.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
88 </example>
89 </para>
90 </refsect1>
91
92 <refsect1>
93 <title>See Also</title>
94 <para><link linkend="SiggenTableacc"><citetitle>Table Access</citetitle></link></para>
95 <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>
96 </refsect1>
97 </refentry>