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

  <refnamediv>
    <refname>vco2ft</refname>
    <refpurpose>
      Returns a table number at k-time for a given oscillator frequency and wavform.
      <indexterm id="IndexVco2ft"><primary>vco2ft</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>vco2ft</emphasis> returns the function table number to be used for generating the specified waveform at a given frequency. This function table number can be used by any Csound opcode that generates a signal by reading function tables (like <link linkend="oscilikt"><citetitle>oscilikt</citetitle></link>). The tables must be calculated by <link linkend="vco2init"><citetitle>vco2init</citetitle></link> before <emphasis>vco2ft</emphasis> is called and shared as Csound ftables (<emphasis>ibasfn</emphasis>).
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>kfn <command>vco2ft</command> kcps, iwave [, inyx]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>iwave</emphasis> -- the waveform for which table number is to be selected. Allowed values are:
        <itemizedlist>
          <listitem><para>0: sawtooth</para></listitem>
          <listitem><para>1: 4 * x * (1 - x)   (integrated sawtooth)</para></listitem>
          <listitem><para>2: pulse (not normalized)</para></listitem>
          <listitem><para>3: square wave</para></listitem>
          <listitem><para>4: triangle</para></listitem>
        </itemizedlist>
    </para>

    <para>
      Additionally, negative <emphasis>iwave</emphasis> values select user defined waveforms (see also <link linkend="vco2init"><citetitle>vco2init</citetitle></link>).
    </para>

    <para>
      <emphasis>inyx</emphasis> (optional, default=0.5) -- bandwidth of the generated waveform, as percentage (0 to 1) of the sample rate. The expected range is 0 to 0.5 (i.e. up to <link linkend="sr"><citetitle>sr</citetitle></link>/2), other values are limited to the allowed range.
    </para>

    <para>
      Setting inyx to 0.25 (sr/4), or 0.3333 (sr/3) can produce a <quote>fatter</quote> sound in some cases, although it is more likely to reduce quality.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kfn</emphasis> -- the ftable number, returned at k-rate.
    </para>

    <para>
      <emphasis>kcps</emphasis> -- frequency in Hz, returned at k-rate. Zero and negative values are allowed. However, if the absolute value exceeds sr/2 (or sr*inyx), the selected table will contain silence.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      See the example for the <link linkend="vco2"><citetitle>vco2</citetitle></link> opcode.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="vco2ift"><citetitle>vco2ift</citetitle></link>,
      <link linkend="vco2init"><citetitle>vco2init</citetitle></link>, and
      <link linkend="vco2"><citetitle>vco2</citetitle></link>.
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Author: &nameistvan;</para>
    <para>New in version 4.22</para>
  </refsect1>
</refentry>
