summaryrefslogtreecommitdiff
path: root/opcodes/tableikt.xml
blob: e87716e45be79302fc513b788ab7ab363a4bc8d8 (plain)
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
<refentry id="tableikt">
<indexterm id="IndexTableikt"><primary>tableikt</primary></indexterm>
  <refentryinfo><title>Table Control:Dynamic Selection</title></refentryinfo>
  <refmeta>
    <refentrytitle>tableikt</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>tableikt</refname>
    <refpurpose>
      Provides k-rate control over table numbers.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      k-rate control over table numbers.
    </para>

    <para>
      The standard Csound opcode <link linkend="tablei"><citetitle>tablei</citetitle></link>, when producing a k- or a-rate result, can only use an init-time variable to select the table number. <emphasis>tableikt</emphasis> accepts k-rate control as well as i-time. In all other respects they are similar to the original opcodes.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>tableikt</command> xndx, kfn [, ixmode] [, ixoff] [, iwrap]</synopsis>

    <synopsis>kres <command>tableikt</command> kndx, kfn [, ixmode] [, ixoff] [, iwrap]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ixmode</emphasis> -- if 0, <emphasis>xndx</emphasis> and <emphasis>ixoff</emphasis> ranges match the length of the table. if non-zero <emphasis>xndx</emphasis> and <emphasis>ixoff</emphasis> have a 0 to 1 range. Default is 0
    </para>

    <para>
      <emphasis>ixoff</emphasis> -- if 0, total index is controlled directly by <emphasis>xndx,</emphasis> ie. the indexing starts from the start of the table. If non-zero, 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). Default is 0.
    </para>

    <para>
      <emphasis>iwrap</emphasis> -- if <emphasis>iwrap</emphasis> = 0, <emphasis>Limit mode</emphasis>: when total index is below 0, then final index is 0.Total index above table length results in a final  index of the table length - high out of range total indexes stick at the upper limit of the table. If <emphasis>iwrap</emphasis> not equal to 0, <emphasis>Wrap mode</emphasis>: total index is wrapped  modulo the table length so that all total indexes map into the table. For instance, in a table of length 8, <emphasis>xndx</emphasis> = 5 and <emphasis>ixoff</emphasis> = 6 gives a total index of 11, which wraps to a final  index of 3. Default is 0.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kndx</emphasis> -- Index into table, either a positive number range
    </para>

    <para>
      <emphasis>xndx</emphasis> -- matching the table length (<emphasis>ixmode</emphasis> = 0) or a 0 to 1 range (<emphasis>ixmode</emphasis> not equal to 0)
    </para>

    <para>
      <emphasis>kfn</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.
    </para>

    <caution>
      <title>Caution with k-rate table numbers</title>
      <para>
        At k-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. <emphasis>kfn</emphasis> must be initialized at the appropriate rate using <link linkend="init"><citetitle>init</citetitle></link>. Attempting to load an i-rate value into <emphasis>kfn</emphasis> will result in an error.
      </para>
    </caution>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="tablekt"><citetitle>tablekt</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Robin Whittle</member>
        <member>Australia</member>
        <member>May 1997</member>
      </simplelist>
    </para>
    <para>New in version 3.47</para>
  </refsect1>
</refentry>