<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="tablexkt">
  <refmeta>
    <refentrytitle>tablexkt</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>tablexkt</refname>
    <refpurpose>
      Reads function tables with linear, cubic, or sinc interpolation.
      <indexterm id="IndexTablexkt"><primary>tablexkt</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Reads function tables with linear, cubic, or sinc interpolation.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>tablexkt</command> xndx, kfn, kwarp, iwsize [, ixmode] [, ixoff] [, iwrap]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>iwsize</emphasis> -- This parameter controls the type of interpolation to be used:
      <itemizedlist>
        <listitem>
          <para><emphasis>2:</emphasis> Use linear interpolation. This is the lowest quality, but also the fastest mode.</para>
        </listitem>

        <listitem>
          <para><emphasis>4:</emphasis> Cubic interpolation. Slightly better quality than iwsize = 2, at
     the expense of being somewhat slower.</para>
        </listitem>

        <listitem>
          <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>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      <emphasis>ixmode1</emphasis> (optional) -- index data mode. The default value is 0.
      <itemizedlist>
        <listitem>
          <para><emphasis>0:</emphasis> raw index</para>
        </listitem>

        <listitem>
          <para><emphasis>any non-zero value:</emphasis> normalized (0 to 1)</para>
        </listitem>
      </itemizedlist>
    </para>

    <note>
      <title>Notes</title>
      <para>
        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).
      </para>
    </note>

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

    <para>
      <emphasis>iwrap</emphasis> (optional) -- wraparound index flag. The default value is 0.
      <itemizedlist>
        <listitem>
          <para><emphasis>0:</emphasis> Nowrap (index &lt; 0 treated as index = 0; index &gt;= tablesize (or 1.0 in normalized mode) sticks at the guard point).</para>
        </listitem>

        <listitem>
          <para><emphasis>any non-zero value:</emphasis> Index is wrapped to the allowed range (not including the guard point in this case).</para>
        </listitem>
      </itemizedlist>
    </para>

    <note>
      <title>Note</title>
      <para>
        <emphasis>iwrap</emphasis> also applies to extra samples for interpolation.
      </para>
    </note>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ar</emphasis> -- audio output
    </para>

    <para>
      <emphasis>xndx</emphasis> -- table index
    </para>

    <para>
      <emphasis>kfn</emphasis> -- function table number
    </para>

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

    <note>
      <title>Note</title>
      <para>
        <emphasis>kwarp</emphasis> has no effect if it is less than, or equal to 1, or linear or cubic interpolation is used.
      </para>
    </note>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &nameistvan;</member>
        <member>January 2002</member>
      </simplelist>
    </para>

    <para>New in version 4.18</para>
  </refsect1>
</refentry>
