<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="nsamp">
  <refmeta>
    <refentrytitle>nsamp</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>nsamp</refname>
    <refpurpose>
      Returns the number of samples loaded into a stored function table number.
      <indexterm id="IndexNsamp"><primary>nsamp</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns the number of samples loaded into a stored function table number.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>nsamp</command>(x) (init-rate args only)</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      Returns the number of samples loaded into stored function table number <emphasis>x</emphasis> by <link linkend="GEN01"><citetitle>GEN01</citetitle></link>. This is useful when a sample is shorter than the power-of-two function table that holds it. New in Csound version 3.49.
    </para>
  </refsect1>

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

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

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

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

      Since the audio file <quote>mary.wav</quote> has 154390 samples, its output should include a line like this:
      <screen>
instr 1:  isz = 154390.000
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="ftchnls"><citetitle>ftchnls</citetitle></link>,
      <link linkend="ftlen"><citetitle>ftlen</citetitle></link>,
      <link linkend="ftlptim"><citetitle>ftlptim</citetitle></link>,
      <link linkend="ftsr"><citetitle>ftsr</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>October 1998</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
