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

    <refpurpose>
      Sends a generic MIDI message to the MIDI OUT port.
      <indexterm id="IndexMidiout"><primary>midiout</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Sends a generic MIDI message to the MIDI OUT port.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>midiout</command> kstatus, kchan, kdata1, kdata2</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kstatus</emphasis> -- the type of MIDI message. Can be:
      <itemizedlist>
	<listitem><para>128 (note off)</para></listitem>
	<listitem><para>144 (note on)</para></listitem>
	<listitem><para>160 (polyphonic aftertouch)</para></listitem>
	<listitem><para>176 (control change)</para></listitem>
	<listitem><para>192 (program change)</para></listitem>
	<listitem><para>208 (channel aftertouch)</para></listitem>
	<listitem><para>224 (pitch bend)</para></listitem>
	<listitem><para>0 when no MIDI messages must be sent to the MIDI OUT port</para></listitem>
      </itemizedlist>
    </para>

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

    <para>
      <emphasis>kdata1, kdata2</emphasis> -- message-dependent data values
    </para>

    <para>
      <emphasis>midiout</emphasis> has no output arguments, because it sends a message to the MIDI OUT port implicitly. It works at k-rate. It sends a MIDI message only when <emphasis>kstatus</emphasis> is non-zero.
    </para>

    <warning>
      <para>
        <emphasis>Warning:</emphasis> Normally <emphasis>kstatus</emphasis> should be set to 0. Only when the user intends to send a MIDI message, can it be set to the corresponding message type number.
      </para>
    </warning>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>1998</member>
      </simplelist>
    </para>

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