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

    <refpurpose>
      Initializes the controller used to create a 7-bit MIDI value.
      <indexterm id="IndexInitc7"><primary>initc7</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Initializes MIDI controller <emphasis>ictlno</emphasis> with <emphasis>ivalue</emphasis>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>initc7</command> ichan, ictlno, ivalue</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ichan</emphasis> -- MIDI channel (1-16)
    </para>

    <para>
      <emphasis>ictlno</emphasis> -- controller number (0-127)
    </para>

    <para>
      <emphasis>ivalue</emphasis> -- floating point value (must be within 0 to 1)
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
     <emphasis>initc7</emphasis> can be used together with both <link linkend="midic7"><citetitle>midic7</citetitle></link> and  <link linkend="ctrl7"><citetitle>ctrl7</citetitle></link> opcodes for initializing the first controller's value. <emphasis>ivalue</emphasis> argument must be set with a number within 0 to 1. An error occurs if it is not. Use the following formula to set <emphasis>ivalue</emphasis> according with <emphasis>midic7</emphasis> and <emphasis>ctrl7</emphasis> min and max range:

       <literallayout>
ivalue = (initial_value - min) / (max - min)
       </literallayout>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="ctrl7"><citetitle>ctrl7</citetitle></link>,
      <link linkend="ctrl14"><citetitle>ctrl14</citetitle></link>,
      <link linkend="ctrl21"><citetitle>ctrl21</citetitle></link>,
      <link linkend="ctrlinit"><citetitle>ctrlinit</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>
