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 135 136 137 138 139 140 141 142 143 144 145 146
|
<HTML>
<TITLE>TABLEGPW</TITLE>
<CENTER><A NAME="tablegpw"></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="./itablew.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./tablera.html">Next</A>
<HR></CENTER>
<H2>
tablegpw, tableng, tablemix, tablecopy, itablegpw, itablemix, itablecopy,
itableng</H2>
<PRE>ir <B>itableng</B> ifn
kr <B>tableng</B> kfn
<B>itablegpw</B> ifn
<B>tablegpw</B> kfn
<B>tablemix</B> kdft, kdoff, klen, ks1ft, ks1off, ks1g, ks2ft, ks2off, ks2g
<B>itablemix</B> idft, idoff, ilen, is1ft, is1off, is1g, is2ft, is2off, is2g
<B>tablecopy</B> kdft, ksft
<B>itablecopy</B> idft, isft</PRE>
<HR>
<H4>
<U>DESCRIPTION</U></H4>
These opcodes allow to copy, mix and interrogate tables.
<H4>
<U>INITIALIZATION</U></H4>
<I>ifn</I>, <I>kfn</I> - Table number to be interrogated
<P><I>kdft</I> - Destination function table.
<P><I>kdoff</I> - Offset to start writing from. Can be negative.
<P><I>kdft</I> - Number of destination function table.
<P><I>ksft</I> - Number of source function table.
<P><I>klen</I> - Number of write operations to perform. Negative means
work backwards.
<P><I>ks1ft</I>, <I>ks2ft</I> - Source function tables. These can be the
same as the destination table, if care is exercised about direction of
copying data.
<P><I>ks1off</I>, <I>ks2off</I> -Offsets to start reading from in source
tables.
<P><I>ks1g</I>, <I>ks2g</I> - Gains to apply when reading from the source
tables. The results are added and the sum is written to the destination
table.
<H4>
<U>PERFORMANCE</U></H4>
<DT>
<B><U>tableng</U></B></DT>
<P>These return the length of the specified table. This will be a power
of two number in most circumstances - it will not show whether a table
has a guardpoint or not - it seems this information is not available in
the table's data structure. If table is not found, then 0 will be returned.
<P>Likely to be useful for setting up code for table manipulation operations,
such as <B>tablemix</B> and <B>tablecopy</B>.
<P><B><U>tablgpw</U></B>
<P>For writing the table's guard point, with the value which is in location
0. Does nothing if table does not exist.
<P>Likely to be useful after manipulating a table with <B>tablemix</B>
or <B>tablecopy.</B>
<P><B><U>tablemix</U></B>
<P>This ugen mixes from two tables, with separate gains into the destination
table. Writing is done for <I>klen</I> locations, usually stepping forward
through the table - if <I>klen</I> is positive. If it is negative, then
the writing and reading order is backwards - towards lower indexes in the
tables. This bidirectional option makes it easy to shift the contents of
a table sideways by reading from it and writing back to it with a different
offset.
<P>If <I>klen</I> is 0, no writing occurs. Note that the internal integer
value of <I>klen</I> is derived from the ANSI C floor() function - which
returns the next most negative integer. Hence a fractional negative <I>klen</I>
value of -2.3 would create an internal length of 3, and cause the copying
to start from the offset locations and proceed for two locations to the
left.
<P>The total index for table reading and writing is calculated from the
starting offset for each table, plus the index value, which starts at 0
and then increments (or decrements) by 1 as mixing proceeds.
<P>These total indexes can potentially be very large, since there is no
restriction on the offset or the <I>klen</I>. However each total index
for each table is ANDed with a length mask (such as 0000 0111 for a table
of length 8) to form a final index which is actually used for reading or
writing. So no reading or writing can occur outside the tables. This is
the same as "wrap" mode in table read and write. These ugens do not read
or write the guardpoint. If a table has been rewritten with one of these,
then if it has a guardpoint which is supposed to contain the same value
as the location 0, then call <B>tablegpw</B> afterwards.
<P>The indexes and offsets are all in table steps - they are not normalised
to 0 - 1. So for a table of length 256, <I>klen</I> should be set to 256
if all the table was to be read or written.
<P>The tables do not need to be the same length - wrapping occurs individually
for each table.
<P><B><U>tablecopy</U></B>
<P>Simple, fast table copy ugens. Takes the table length from the destination
table, and reads from the start of the source table. For speed reasons,
does not check the source length - just copies regardless - in "wrap" mode.
This may read through the source table several times. A source table with
length 1 will cause all values in the destination table to be written to
its value.
<P>Table copy cannot read or write the guardpoint. To read it use table
read, with ndx = the table length. Likewise use table write to write it.
<P>To write the guardpoint to the value in location 0, use tablegpw.
<P>This is primarily to change function tables quickly in a real-time situation.
<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="./itablew.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./tablera.html">Next</A>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|