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

    <refpurpose>
      Allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range.
      <indexterm id="IndexCtrl14"><primary>ctrl14</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>idest <command>ctrl14</command> ichan, ictlno1, ictlno2, imin, imax [, ifn]</synopsis>

    <synopsis>kdest <command>ctrl14</command> ichan, ictlno1, ictlno2, kmin, kmax [, ifn]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>idest</emphasis> -- output signal
    </para>

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

    <para>
      <emphasis>ictln1o</emphasis> -- most-significant byte controller number (0-127)
    </para>

    <para>
      <emphasis>ictlno2</emphasis> -- least-significant byte controller number (0-127)
    </para>

    <para>
      <emphasis>imin</emphasis> -- user-defined minimum floating-point value of output
    </para>

    <para>
      <emphasis>imax</emphasis> -- user-defined maximum floating-point value of output
    </para>

    <para>
      <emphasis>ifn</emphasis> (optional) -- table to be read when indexing is required. Table must be normalized. Output is scaled according to <emphasis>imax</emphasis> and <emphasis>imin</emphasis> val.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kdest</emphasis> -- output signal
    </para>

    <para>
      <emphasis>kmin</emphasis> -- user-defined minimum floating-point value of output
    </para>

    <para>
      <emphasis>kmax</emphasis> -- user-defined maximum floating-point value of output
    </para>

    <para>
      <emphasis>ctrl14</emphasis> (i- and k-rate 14 bit MIDI control) allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range. The minimum and maximum values can be varied at k-rate. It can use optional interpolated table indexing. It requires two MIDI controllers as input.
    </para>

    <para>
      <emphasis>ctrl14</emphasis> differs from <link linkend="midic14"><citetitle>midic14</citetitle></link> becase it can be included in score-oriented instruments without Csound crashes. It needs the additional parameter <emphasis>ichan</emphasis> containing the MIDI channel of the controller. MIDI channel is the same for all the controllers used in a single <emphasis>ctrl14</emphasis> opcode.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="ctrl7"><citetitle>ctrl7</citetitle></link>,
      <link linkend="ctrl21"><citetitle>ctrl21</citetitle></link>,
      <link linkend="initc7"><citetitle>initc7</citetitle></link>,
      <link linkend="initc14"><citetitle>initc14</citetitle></link>,
      <link linkend="initc21"><citetitle>initc21</citetitle></link>,
      <link linkend="midic7"><citetitle>midic7</citetitle></link>,
      <link linkend="midic14"><citetitle>midic14</citetitle></link>,
      <link linkend="midic21"><citetitle>midic21</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>
