<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="delay">
  <refmeta>
    <refentrytitle>delay</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>delay</refname>
    <refpurpose>
      Delays an input signal by some time interval.
      <indexterm id="IndexDelay"><primary>delay</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      A signal can be read from or written into a delay path, or it can be automatically delayed by some time interval.
   </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>delay</command> asig, idlt [, iskip]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>idlt</emphasis> -- requested delay time in seconds. This can be as large as available memory will permit. The space required for n seconds of delay is 4n * <emphasis>sr</emphasis> bytes. It is allocated at the time the instrument is first initialized, and returned to the pool at the end of a score section.
    </para>

    <para>
      <emphasis>iskip</emphasis> (optional, default=0) -- initial disposition of delay-loop data space (see <link linkend="reson"><citetitle>reson</citetitle></link>). The default value is 0.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>asig</emphasis> -- audio signal
    </para>

    <para>
      <emphasis>delay</emphasis> is a composite of <link linkend="delayr"><citetitle>delayr</citetitle></link> and <link linkend="delayw"><citetitle>delayw</citetitle></link>, both reading from and writing into its own storage area. It can thus accomplish signal time-shift, although modified feedback is not possible. There is no minimum delay period.
    </para>
  </refsect1>

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

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

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

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

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="delay1"><citetitle>delay1</citetitle></link>, 
      <link linkend="delayr"><citetitle>delayr</citetitle></link>, 
      <link linkend="delayw"><citetitle>delayw</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
