<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="poscil">
  <refmeta>
    <refentrytitle>poscil</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>poscil</refname>
    <refpurpose>
      High precision oscillator.
      <indexterm id="Indexposcil"><primary>poscil</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      High precision oscillator.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>poscil</command> aamp, acps, ifn [, iphs]</synopsis>

    <synopsis>ar <command>poscil</command> aamp, kcps, ifn [, iphs]</synopsis>

    <synopsis>ar <command>poscil</command> kamp, acps, ifn [, iphs]</synopsis>

    <synopsis>ar <command>poscil</command> kamp, kcps, ifn [, iphs]</synopsis>

    <synopsis>ir <command>poscil</command> kamp, kcps, ifn [, iphs]</synopsis>

    <synopsis>kr <command>poscil</command> kamp, kcps, ifn [, iphs]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifn</emphasis> -- function table number
    </para>

    <para>
      <emphasis>iphs</emphasis> (optional, default=0) -- initial phase (in samples)
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ar</emphasis> -- output signal
    </para>

    <para>
      <emphasis>kamp</emphasis>, <emphasis>aamp</emphasis> -- the amplitude of the output signal.
    </para>

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

    <para>
      <emphasis>poscil</emphasis> (precise oscillator) is the same as <link linkend="oscili"><citetitle>oscili</citetitle></link>, but allows much more precise frequency control, especially when using long tables and low frequency values. It uses floating-point table indexing, instead of integer math, like <emphasis>oscil</emphasis> and <emphasis>oscili</emphasis>.  It is only a bit slower than <emphasis>oscili</emphasis>.
    </para>

    <para>
      Since Csound 4.22, <emphasis>poscil</emphasis> can accept also negative frequency values and use a-rate values both for amplitude and frequency. So both AM and FM are allowed using this opcode.
    </para>
  </refsect1>

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

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

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

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

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="poscil3"><citetitle>poscil3</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>1998</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

    <para>November 2002. Added a note about the changes to Csound version 4.22, thanks to &namerasmus;.</para>
    <para>New in Csound version 3.52</para>
  </refsect1>
</refentry>
