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

    <refpurpose>
      Plays MIDI notes.
      <indexterm id="IndexMidion"><primary>midion</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Plays MIDI notes.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>midion</command> kchn, knum, kvel</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kchn</emphasis> -- MIDI channel number (1-16)
    </para>

    <para>
      <emphasis>knum</emphasis> -- note number (0-127)
    </para>

    <para>
      <emphasis>kvel</emphasis> -- velocity (0-127)
    </para>

    <para>
      <emphasis>midion</emphasis> (k-rate note on) plays MIDI notes with current <emphasis>kchn</emphasis>, <emphasis>knum</emphasis> and <emphasis>kvel</emphasis>. These arguments can be varied at k-rate. Each time the MIDI converted value of any of these arguments changes, last MIDI note played by current instance of <emphasis>midion</emphasis> is immediately turned off and a new note with the new argument values is activated. This opcode, as well as <emphasis>moscil</emphasis>, can generate very complex melodic textures if controlled by complex k-rate signals.
    </para>

    <para>
      Any number of <emphasis>midion</emphasis> opcodes can appear in the same Csound instrument, allowing a counterpoint-style polyphony within a single instrument.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="moscil"><citetitle>moscil</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>May 1997</member>
      </simplelist>
    </para>

    <para>Thanks goes to &namerasmus; for pointing out the correct MIDI channel and controller number ranges.</para>
  </refsect1>
</refentry>
