<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="oscils">
  <refmeta>
    <refentrytitle>oscils</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>oscils</refname>
    <refpurpose>
      A simple, fast sine oscillator
      <indexterm id="IndexOscils"><primary>oscils</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Simple, fast sine oscillator, that uses only one multiply, and two add operations to generate one sample of output, and does not require a function table.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>oscils</command> iamp, icps, iphs [, iflg]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>iamp</emphasis> -- output amplitude.
    </para>

    <para>
      <emphasis>icps</emphasis> -- frequency in Hz (may be zero or negative, however the absolute value must be less than sr/2).
    </para>

    <para>
      <emphasis>iphs</emphasis> -- start phase between 0 and 1.
    </para>

    <para>
      <emphasis>iflg</emphasis> -- sum of the following values:
      <itemizedlist>
        <listitem>
          <para>
            <emphasis>2</emphasis>: use double precision even if Csound was compiled to use floats.  This improves quality (especially in the case of long performance time), but may be up to twice as slow.
          </para>
        </listitem>

        <listitem>
          <para>
            <emphasis>1</emphasis>: skip initialization.
          </para>
        </listitem>
      </itemizedlist>
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ar</emphasis> -- audio output
    </para>
  </refsect1>

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

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

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

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

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &nameistvan;</member>
        <member>January 2002</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

    <para>New in version 4.18</para>
  </refsect1>
</refentry>
