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

    <refpurpose>
      A MIDI delay opcode.
      <indexterm id="IndexMdelay"><primary>mdelay</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      A MIDI delay opcode.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>mdelay</command> kstatus, kchan, kd1, kd2, kdelay</synopsis>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kstatus</emphasis> -- status byte of MIDI message to be delayed
    </para>

    <para>
      <emphasis>kchan</emphasis> -- MIDI channel (1-16)
    </para>

    <para>
      <emphasis>kd1</emphasis> -- first MIDI data byte
    </para>

    <para>
      <emphasis>kd2</emphasis> -- second MIDI data byte
    </para>

    <para>
      <emphasis>kdelay</emphasis> -- delay time in seconds
    </para>

    <para>
      Each time that <emphasis>kstatus</emphasis> is other than zero, <emphasis>mdelay</emphasis> outputs a MIDI message to the MIDI out port after <emphasis>kdelay</emphasis> seconds. This opcode is useful in implementing MIDI delays. Several instances of <emphasis>mdelay</emphasis> can be present in the same instrument with different argument values, so complex and colorful MIDI echoes can be implemented. Further, the delay time can be changed at k-rate.
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>November 1998</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.492</para>
  </refsect1>
</refentry>
