<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="ftlen">
  <refmeta>
    <refentrytitle>ftlen</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>ftlen</refname>
    <refpurpose>
      Returns the size of a stored function table.
      <indexterm id="IndexFtlen"><primary>ftlen</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns the size of a stored function table.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>ftlen</command>(x) (init-rate args only)</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      Returns the size (number of points, excluding guard point) of stored function table, number <emphasis>x</emphasis>. While most units referencing a stored table will automatically take its size into account (so tables can be of arbitrary length), this function reports the actual size if that is needed. Note that <emphasis>ftlen</emphasis> will always return a power-of-2 value, i.e. the function table guard point (see <link linkend="f"><citetitle>f Statement</citetitle></link>) is not included.As of Csound version 3.53, <emphasis>ftlen</emphasis> works with deferred function tables (see <link linkend="GEN01"><citetitle>GEN01</citetitle></link>).
    </para>
  </refsect1>

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

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

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

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

      The audio file <quote>mary.wav</quote> is 154390 samples long. The ftlen opcode reports it as 154389 samples long because it reserves 1 point for the guard point. Its output should include a line like this:
      <screen>
instr 1:  ilen = 154389.000
      </screen>
    </para>
  </refsect1>
 
  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="ftchnls"><citetitle>ftchnls</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: &namebarry;</member>
        <member>MIT</member>
        <member>Cambridge, Massachussetts</member>
        <member>1997</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
