<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="loscil3">
  <refmeta>
    <refentrytitle>loscil3</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>loscil3</refname>
    <refpurpose>
      Read sampled sound from a table using cubic interpolation.
      <indexterm id="IndexLoscil3"><primary>loscil3</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Read sampled sound from a table using cubic interpolation.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar [,ar2] <command>loscil3</command> xamp, kcps, ifn [, ibas] [, imod1] [, ibeg1] [, iend1] [, imod2] [, ibeg2] [, iend2]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifn</emphasis> -- function table number, typically denoting an AIFF sampled sound segment with prescribed looping points. The source file may be mono or stereo.
    </para>

    <para>
      <emphasis>ibas</emphasis> (optional) -- base frequency in <emphasis>Hz</emphasis> of the recorded sound. This optionally overrides the frequency given in the AIFF file, but is required if the file did not contain one. The default value is 261.626 Hz, i.e. middle C. (New in Csound 4.03). 
    </para>

    <para>
      <emphasis>imod1, imod2</emphasis> (optional, default=-1) -- play modes for the sustain and release loops. A value of 1 denotes normal looping, 2 denotes forward &amp; backward looping, 0 denotes no looping. The default value (-1) will defer to the mode and the looping points given in the source file.
    </para>

    <para>
      <emphasis>ibeg1, iend1, ibeg2, iend2</emphasis> (optional, dependent on <emphasis>mod1, mod2</emphasis>) -- begin and end points of the sustain and release loops. These are measured in <emphasis>sample frames</emphasis> from the beginning of the file, so will look the same whether the sound segment is monaural or stereo.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>

    <para>
      <emphasis>ar1, ar2</emphasis> -- the output at audio-rate. There is just <emphasis>ar1</emphasis> for mono output. However, there is both <emphasis>ar1</emphasis> and <emphasis>ar2</emphasis> for stereo output.
    </para>

    <para>
      <emphasis>xamp</emphasis> -- the amplitude of the output signal.
    </para>

    <para>
      <emphasis>kcps</emphasis> -- the frequency of the output signal in cycles per second.
    </para>

    <para>
      <emphasis>loscil3</emphasis> is experimental. It is identical to <link linkend="loscil"><citetitle>loscil</citetitle></link> except that it uses cubic interpolation. New in Csound version 3.50.
    </para>

    <note>
      <title>Note</title>
      <para>
        This is mono loscil3:

        <informalexample>
          <programlisting>
a1 loscil3 10000, 1, 1
          </programlisting>
        </informalexample>
 
        ...and this is stereo loscil3:
 
        <informalexample>
          <programlisting>
a1, a2 loscil3 10000, 1, 1
          </programlisting>
        </informalexample>
      </para>
    </note>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the loscil3 opcode. It uses the files <ulink url="examples/loscil3.orc"><citetitle>loscil3.orc</citetitle></ulink>, <ulink url="examples/loscil3.sco"><citetitle>loscil3.sco</citetitle></ulink>, and <ulink url="examples/beats.aiff"><citetitle>beats.aiff</citetitle></ulink>.

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

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

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

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="loscil"><citetitle>loscil</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Note about the mono/stereo difference was contributed by &namerasmus;.</para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
