File: itablew.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (134 lines) | stat: -rw-r--r-- 6,083 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<HTML>
<TITLE>ITABLEW</TITLE>
<CENTER><A NAME="itablew"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A>
- <A HREF="./SIG_GENS.html#">Top of this section</A></B> - <A HREF="./oscil.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./tablegpw.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
itablew, tablew, tablewkt</H2>

<PRE>&nbsp;&nbsp; <B>itablew</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isig, indx, ifn [, ixmode] [, ixoff] [, iwgmode]
&nbsp;&nbsp; <B>tablew</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ksig, kndx, ifn [, ixmode] [, ixoff] [, iwgmode]&nbsp;
&nbsp;&nbsp; <B>tablew</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asig, andx, ifn [, ixmode] [, ixoff] [, iwgmode]&nbsp;
&nbsp;&nbsp; <B>tablewkt</B>&nbsp;&nbsp;&nbsp;&nbsp; ksig, kndx, kfn [, ixmode] [, ixoff] [, iwgmode]&nbsp;&nbsp;
&nbsp;&nbsp; <B>tablewkt</B>&nbsp;&nbsp;&nbsp;&nbsp; asig, andx, kfn [, ixmode] [, ixoff] [, iwgmode]</PRE>

<HR>
<H4>
<U>DESCRIPTION</U></H4>
These opcodes operate on existing function tables, changing their contents.
<B>itablew</B> is used when all inputs are init time variables or constants
and you only want to run it at the initialisation of the instrument. <B>tablew</B>
is for writing at k or at a rates, with the table number being specified
at init time. <B>tablewkt</B> is the same, but uses a k rate variable for
selecting the table number. The valid combinations of variable types are
shown by the first letter of the variable names.
<H4>
<U>INITIALIZATION</U></H4>
<I>isig</I>, <I>ksig,</I> <I>asig</I>- The value to be written into the
table.

<P><I>indx</I>, <I>kndx</I>, <I>andx</I> - Index into table, either a positive
number range matching the table length (<I>ixmode</I> = 0) or a 0 to 1
range (<I>ixmode</I> != 0)

<P><I>ifn</I>, <I>kfn</I> - Table number. Must be >= 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 (gen01) then an error will result
and the instrument will be de-activated.

<P><I>ixmode</I> - 0 : <I>xndx</I> and <I>ixoff</I> ranges match the length
of the table. !=0 : <I>xndx</I> and <I>ixoff</I> have a 0 to 1 range. Default
0

<P><I>ixoff</I> - 0: Total index is controlled directly by <I>xndx</I>.
ie. the indexing starts from the start of the table. !=0: Start indexing
from somewhere else in the table. Value must be positive and less than
the table length (<I>ixmode</I> = 0) or less than 1 (<I>ixmode</I> !=0).
Default 0

<P><I>iwgmode</I> - 0: Limit mode; 1: Wrap mode; 2: Guardpoint mode. Default
0
<H4>
<U>PERFORMANCE</U></H4>
<B><U>Limit mode</U> (0)</B>

<P>Limit the total index (<I>ndx</I> + <I>ixoff</I>) 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. Total indexes > 4 write to location 4.

<P><B><U>Wrap mode</U> (1)</B>

<P>Wrap total index value into locations 0 to E, where E is one less than
either 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.

<P><B><U>Guardpoint mode</U> (2)</B>

<P>The guardpoint is written at the same time as location 0 is written
- with the same value.

<P>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.

<P>Normally (igwmode = 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. ("0.999" 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 (igwmode = 0) or to 3.999 (igwmode
= 1). igwmode = 0 enables locations 0 to 4 to be written - with the guardpoint
(4) being written with a potentially different value from location 0.

<P>With a table of length 5 and the <I>iwgmode</I> = 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.

<P>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.

<P>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 the table (locations 0 to
3 in our example) and then writing to the guard point if index == 0.

<P><B>tablew</B> has no output value. The last three parameters are optional
and have default values of 0.

<P><B><U>Caution with k rate table numbers :</U></B>

<P>The following notes also apply to the tablekt and tableikt ugens which
can now have their table number changed at k rate.

<P>At k rate or a rate, if a table number of &lt; 1 is given, or the table
number points to a non-existent table, or to one which has a length of
0 (it is to be loaded from a file later) then an error will result and
the instrument will be deactivated.
<H4>
<U>AUTHOR:</U></H4>
Robin Whittle
<BR>Australia
<BR>May 1997
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A>
- <A HREF="./SIG_GENS.html#">Top of this section</A></B> - <A HREF="./oscil.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./tablegpw.html">Next</A>&nbsp;
<HR></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>