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

    <refpurpose>
      Sends polyphonic MIDI aftertouch messages at k-rate.
      <indexterm id="IndexOutkpat"><primary>outkpat</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Sends polyphonic MIDI aftertouch messages at k-rate.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>outkpat</command> kchn, knotenum, kvalue, kmin, kmax</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kchn</emphasis> -- MIDI channel number (1-16)
    </para>

    <para>
      <emphasis>knotenum</emphasis> -- MIDI note number (used in polyphonic aftertouch messages)
    </para>

    <para>
      <emphasis>kvalue</emphasis> -- floating point value
    </para>

    <para>
      <emphasis>kmin</emphasis> -- minimum floating point value (converted in MIDI integer value 0)
    </para>

    <para>
      <emphasis>kmax</emphasis> -- maximum floating point value (converted in MIDI integer value 127 (7 bit))
    </para>

    <para>
     <emphasis>outkpat</emphasis> (k-rate polyphonic aftertouch output) sends polyphonic aftertouch messages. It works only with MIDI instruments which recognize them. It can drive a different value of a parameter for each note currently active. 
    </para>

    <para>
      It can scale the k-value floating-point argument according to the <emphasis>kmin</emphasis> and <emphasis>kmax</emphasis> values. For example: set <emphasis>kmin</emphasis> = 1.0 and <emphasis>kmax</emphasis> = 2.0.
When the <emphasis>kvalue</emphasis> argument receives a 2.0 value, the opcode will send a 127 value to the MIDI OUT device. When the <emphasis>kvalue</emphasis> argument receives a 1.0 value, it will send a 0 value. k-rate opcodes send a message each time the MIDI converted value of argument <emphasis>kvalue</emphasis> changes.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="outiat"><citetitle>outiat</citetitle></link>,
      <link linkend="outic14"><citetitle>outic14</citetitle></link>,
      <link linkend="outic"><citetitle>outic</citetitle></link>,
      <link linkend="outipat"><citetitle>outipat</citetitle></link>,
      <link linkend="outipb"><citetitle>outipb</citetitle></link>,
      <link linkend="outipc"><citetitle>outipc</citetitle></link>,
      <link linkend="outkat"><citetitle>outkat</citetitle></link>,
      <link linkend="outkc14"><citetitle>outkc14</citetitle></link>,
      <link linkend="outkc"><citetitle>outkc</citetitle></link>,
      <link linkend="outkpb"><citetitle>outkpb</citetitle></link>,
      <link linkend="outkpc"><citetitle>outkpc</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
      </simplelist>
    </para>

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