<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="ftchnls">
  <refmeta>
    <refentrytitle>ftchnls</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>ftchnls</refname>
    <refpurpose>
      Returns the number of channels in a stored function table.
      <indexterm id="IndexFtchnls"><primary>ftchnls</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns the number of channels in a stored function table.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>ftchnls</command>(x) (init-rate args only)</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      Returns the number of channels of a <link linkend="GEN01"><citetitle>GEN01</citetitle></link> table, determined from the header of the original file.  If the original file has no header or the table was not created by these GEN01, <emphasis>ftchnls</emphasis> returns -1.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the ftchnls opcode. It uses the files <ulink url="examples/ftchnls.orc"><citetitle>ftchnls.orc</citetitle></ulink>, <ulink url="examples/ftchnls.sco"><citetitle>ftchnls.sco</citetitle></ulink>, and <ulink url="examples/mary.wav"><citetitle>mary.wav</citetitle></ulink>.

      <example>
        <title>Example of the ftchnls opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/ftchnls.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/ftchnls.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Since the audio file <quote>mary.wav</quote> is monophonic (1 channel), its output should include a line like this:
      <screen>
instr 1:  ichnls = 1.000
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="ftlen"><citetitle>ftlen</citetitle></link>,
      <link linkend="ftlptim"><citetitle>ftlptim</citetitle></link>,
      <link linkend="ftsr"><citetitle>ftsr</citetitle></link>,
      <link linkend="nsamp"><citetitle>nsamp</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Chris McCormick</member>
        <member>Perth, Australia</member>
        <member>December 2001</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
