| 1 | |
| 2 | <refentry id="tablexkt"> |
| 3 | <indexterm id="IndexTablexkt"><primary>tablexkt</primary></indexterm> |
| 4 | <refentryinfo><title>Table Control:Dynamic Selection</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>tablexkt</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>tablexkt</refname> |
| 13 | <refpurpose> |
| 14 | Reads function tables with linear, cubic, or sinc interpolation. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Reads function tables with linear, cubic, or sinc interpolation. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>tablexkt</command> xndx, kfn, kwarp, iwsize [, ixmode] [, ixoff] [, iwrap]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>iwsize</emphasis> -- This parameter controls the type of interpolation to be used: |
| 34 | <itemizedlist> |
| 35 | <listitem> |
| 36 | <para><emphasis>2:</emphasis> Use linear interpolation. This is the lowest quality, but also the fastest mode.</para> |
| 37 | </listitem> |
| 38 | |
| 39 | <listitem> |
| 40 | <para><emphasis>4:</emphasis> Cubic interpolation. Slightly better quality than iwsize = 2, at |
| 41 | the expense of being somewhat slower.</para> |
| 42 | </listitem> |
| 43 | |
| 44 | <listitem> |
| 45 | <para><emphasis>8 and above (up to 1024):</emphasis> sinc interpolation with window size set to iwsize (should be an integer multiply of 4). Better quality than linear or cubic interpolation, but very slow. When transposing up, a kwarp value above 1 can be used for anti-aliasing (this is even slower).</para> |
| 46 | </listitem> |
| 47 | </itemizedlist> |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | <emphasis>ixmode1</emphasis> (optional) -- index data mode. The default value is 0. |
| 52 | <itemizedlist> |
| 53 | <listitem> |
| 54 | <para><emphasis>0:</emphasis> raw index</para> |
| 55 | </listitem> |
| 56 | |
| 57 | <listitem> |
| 58 | <para><emphasis>any non-zero value:</emphasis> normalized (0 to 1)</para> |
| 59 | </listitem> |
| 60 | </itemizedlist> |
| 61 | </para> |
| 62 | |
| 63 | <note> |
| 64 | <title>Notes</title> |
| 65 | <para> |
| 66 | if <emphasis>tablexkt</emphasis> is used to play back samples with looping (e.g. table index is generated by lphasor), there must be at least iwsize / 2 extra samples after the loop end point for interpolation, otherwise audible clicking may occur (also, at least iwsize / 2 samples should be before the loop start point). |
| 67 | </para> |
| 68 | </note> |
| 69 | |
| 70 | <para> |
| 71 | <emphasis>ixoff</emphasis> (optional) -- amount by which index is to be offset. For a table with origin at center, use tablesize / 2 (raw) or 0.5 (normalized). The default value is 0. |
| 72 | </para> |
| 73 | |
| 74 | <para> |
| 75 | <emphasis>iwrap</emphasis> (optional) -- wraparound index flag. The default value is 0. |
| 76 | <itemizedlist> |
| 77 | <listitem> |
| 78 | <para><emphasis>0:</emphasis> Nowrap (index < 0 treated as index = 0; index >= tablesize (or 1.0 in normalized mode) sticks at the guard point).</para> |
| 79 | </listitem> |
| 80 | |
| 81 | <listitem> |
| 82 | <para><emphasis>any non-zero value:</emphasis> Index is wrapped to the allowed range (not including the guard point in this case).</para> |
| 83 | </listitem> |
| 84 | </itemizedlist> |
| 85 | </para> |
| 86 | |
| 87 | <note> |
| 88 | <title>Note</title> |
| 89 | <para> |
| 90 | <emphasis>iwrap</emphasis> also applies to extra samples for interpolation. |
| 91 | </para> |
| 92 | </note> |
| 93 | </refsect1> |
| 94 | |
| 95 | <refsect1> |
| 96 | <title>Performance</title> |
| 97 | <para> |
| 98 | <emphasis>ares</emphasis> -- audio output |
| 99 | </para> |
| 100 | |
| 101 | <para> |
| 102 | <emphasis>xndx</emphasis> -- table index |
| 103 | </para> |
| 104 | |
| 105 | <para> |
| 106 | <emphasis>kfn</emphasis> -- function table number |
| 107 | </para> |
| 108 | |
| 109 | <para> |
| 110 | <emphasis>kwarp</emphasis> -- if greater than 1, use sin (x / kwarp) / x function for sinc interpolation, instead of the default sin (x) / x. This is useful to avoid aliasing when transposing up (<emphasis>kwarp</emphasis> should be set to the transpose factor in this case, e.g. 2.0 for one octave), however it makes rendering up to twice as slow. Also, <emphasis>iwsize</emphasis> should be at least kwarp * 8. This feature is experimental, and may be optimized both in terms of speed and quality in new versions. |
| 111 | </para> |
| 112 | |
| 113 | <note> |
| 114 | <title>Note</title> |
| 115 | <para> |
| 116 | <emphasis>kwarp</emphasis> has no effect if it is less than, or equal to 1, or linear or cubic interpolation is used. |
| 117 | </para> |
| 118 | </note> |
| 119 | </refsect1> |
| 120 | <refsect1> |
| 121 | <title>Examples</title> |
| 122 | <para> |
| 123 | Here is an example of the tablexkt opcode. It uses the file <ulink url="examples/tablexkt.csd"><citetitle>tablexkt.csd</citetitle></ulink>. |
| 124 | |
| 125 | <example> |
| 126 | <title>Example of the tablexkt opcode.</title> |
| 127 | |
| 128 | <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> |
| 129 | <xi:include href="examples-xml/tablexkt.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 130 | </example> |
| 131 | </para> |
| 132 | </refsect1> |
| 133 | |
| 134 | <refsect1> |
| 135 | <title>See also</title> |
| 136 | <para><link linkend="TableSelect"><citetitle>Table Reading with Dynamic Selection</citetitle></link></para> |
| 137 | </refsect1> |
| 138 | |
| 139 | <refsect1> |
| 140 | <title>Credits</title> |
| 141 | <para> |
| 142 | <simplelist> |
| 143 | <member>Author: &nameistvan;</member> |
| 144 | <member>January 2002</member> |
| 145 | <member>Example by: Jonathan Murphy 2006</member> |
| 146 | </simplelist> |
| 147 | </para> |
| 148 | |
| 149 | <para>New in version 4.18</para> |
| 150 | </refsect1> |
| 151 | </refentry> |