Debian Codegraph @

opcodes/tableiw.xml

raw symbols SCIP
1
2 <refentry id="tableiw">
3 <indexterm id="IndexTableiw"><primary>tableiw</primary></indexterm>
4 <refentryinfo><title>Deprecated</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>tableiw</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>tableiw</refname>
13 <refpurpose>
14 Deprecated.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Deprecated as of version 3.49. Use the
22 <link linkend="tablew"><citetitle>tablew</citetitle></link>
23 opcode instead.
24 <!-- This opcode operates on existing function tables, changing their -->
25 <!-- contents. <emphasis>tableiw</emphasis> is used when all inputs -->
26 <!-- are init time variables or constants and you only want to run it -->
27 <!-- at the initialization of the instrument. The valid combinations -->
28 <!-- of variable types are shown by the first letter of the variable -->
29 <!-- names. -->
30 </para>
31 </refsect1>
32
33 <refsect1>
34 <title>Syntax</title>
35 <synopsis><command>tableiw</command> isig, indx, ifn [, ixmode] [, ixoff] [, iwgmode]</synopsis>
36 </refsect1>
37
38 <refsect1>
39 <title>Initialization</title>
40 <para>
41 <emphasis>isig</emphasis> -- Input value to write to the table.
42 </para>
43
44 <para>
45 <emphasis>indx</emphasis> -- Index into table, either a positive number range matching the table length (<emphasis>ixmode</emphasis> = 0) or a 0 to 1 range (<emphasis>ixmode</emphasis> not equal to 0)
46 </para>
47
48 <para>
49 <emphasis>ifn</emphasis> -- Table number. Must be &gt;= 1. Floats are rounded down to an integer. If a table number does not point to a valid table, or the table has not yet been loaded (<link linkend="GEN01"><citetitle>GEN01</citetitle></link>) then an error will result and the instrument will be de-activated.
50 </para>
51
52 <para>
53 <emphasis>ixmode</emphasis> (optional, default=0) -- index mode.
54 <itemizedlist>
55 <listitem>
56 <para>
57 0 = <emphasis>indx</emphasis> and <emphasis>ixoff</emphasis> ranges match the length of the table.
58 </para>
59 </listitem>
60
61 <listitem>
62 <para>
63 not equal to 0 = <emphasis>indx</emphasis> and <emphasis>ixoff</emphasis> have a 0 to 1 range.
64 </para>
65 </listitem>
66 </itemizedlist>
67 </para>
68
69 <para>
70 <emphasis>ixoff</emphasis> (optional, default=0) -- index offset.
71
72 <itemizedlist>
73 <listitem>
74 <para>
75 0 = Total index is controlled directly by <emphasis>indx</emphasis>, i.e. the indexing starts from the start of the table.
76 </para>
77 </listitem>
78
79 <listitem>
80 <para>
81 Not equal to 0 = Start indexing from somewhere else in the table. Value must be positive and less than the table length (<emphasis>ixmode</emphasis> = 0) or less than 1 (<emphasis>ixmode</emphasis> not equal to 0).
82 </para>
83 </listitem>
84 </itemizedlist>
85 </para>
86
87 <para>
88 <emphasis>iwgmode</emphasis> (optional, default=0) -- Wrap and guard point mode.
89
90 <itemizedlist>
91 <listitem>
92 <para>
93 0 = Limit mode.
94 </para>
95 </listitem>
96
97 <listitem>
98 <para>
99 1 = Wrap mode.
100 </para>
101 </listitem>
102
103 <listitem>
104 <para>
105 2 = Guardpoint mode.
106 </para>
107 </listitem>
108 </itemizedlist>
109 </para>
110 </refsect1>
111
112 <refsect1>
113 <title>Performance</title>
114
115 <refsect2>
116 <title>Limit mode (0)</title>
117 <para>
118 Limit the total index (<emphasis>indx</emphasis> + <emphasis>ixoff</emphasis>) to between 0 and the guard point. For a table of length 5, this means that locations 0 to 3 and location 4 (the guard point) can be written. A negative total index writes to location 0.
119 </para>
120 </refsect2>
121
122 <refsect2>
123 <title>Wrap mode (1)</title>
124 <para>
125 Wrap total index value into locations 0 to E, where E is either one less than the table length or the factor of 2 number which is one less than the table length. For example, wrap into a 0 to 3 range - so that total index 6 writes to location 2.
126 </para>
127 </refsect2>
128
129 <refsect2>
130 <title>Guardpoint mode (2)</title>
131 <para>
132 The guardpoint is written at the same time as location 0 is written - with the same value.
133 </para>
134
135 <para>
136 This facilitates writing to tables which are intended to be read with interpolation for producing smooth cyclic waveforms. In addition, before it is used, the total index is incremented by half the range between one location and the next, before being rounded down to the integer address of a table location.
137 </para>
138
139 <para>
140 Normally (<emphasis>iwgmode</emphasis> = 0 or 1) for a table of length 5 - which has locations 0 to 3 as the main table and location 4 as the guard point, a total index in the range of 0 to 0.999 will write to location 0. (&quot;0.999&quot; means just less than 1.0.) 1.0 to 1.999 will write to location 1 etc. A similar pattern holds for all total indexes 0 to 4.999 (<emphasis>igwmode</emphasis> = 0) or to 3.999 (<emphasis>igwmode</emphasis> = 1). <emphasis>igwmode</emphasis> = 0 enables locations 0 to 4 to be written - with the guardpoint (4) being written with a potentially different value from location 0.
141 </para>
142
143 <para>
144 With a table of length 5 and the <emphasis>iwgmode</emphasis> = 2, then when the total index is in the range 0 to 0.499, it will write to locations 0 and 4. Range 0.5 to 1.499 will write to location 1 etc. 3.5 to 4.0 will also write to locations 0 and 4.
145 </para>
146
147 <para>
148 This way, the writing operation most closely approximates the results of interpolated reading. Guard point mode should only be used with tables that have a guardpoint.
149 </para>
150
151 <para>
152 Guardpoint mode is accomplished by adding 0.5 to the total index, rounding to the next lowest integer, wrapping it modulo the factor of two which is one less than the table length, writing the table (locations 0 to 3 in our example) and then writing to the guard point if index = 0.
153 </para>
154 </refsect2>
155 </refsect1>
156
157 <refsect1>
158 <title>Examples</title>
159 <para>
160 Here is an example of the tableiw opcode. It uses the file <ulink url="examples/tableiw.csd"><citetitle>tableiw.csd</citetitle></ulink>.
161 <example>
162 <title>Example of the tableiw opcode.</title>
163 <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>
164 <xi:include href="examples-xml/tableiw.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
165 </example>
166 </para>
167 </refsect1>
168
169 <refsect1>
170 <title>See Also</title>
171 <para>
172 <link linkend="tablew"><citetitle>tablew</citetitle></link>,
173 <link linkend="tablewkt"><citetitle>tablewkt</citetitle></link>
174 </para>
175 <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>
176 </refsect1>
177
178 <refsect1>
179 <title>Credits</title>
180 <para>
181 <simplelist>
182 <member>Author: Robin Whittle</member>
183 <member>Australia</member>
184 <member>May 1997</member>
185 </simplelist>
186 </para>
187 <para>New in version 3.47</para>
188
189 <para>Updated August 2002, thanks go to Abram Hindle for pointing out the correct syntax.</para>
190 </refsect1>
191 </refentry>