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

    <refpurpose>
      Converts a pitch-class value into cycles-per-second for equal divisions of the octave.
      <indexterm id="IndexCps2pch"><primary>cps2pch</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Converts a pitch-class value into cycles-per-second (Hz) for equal divisions of the octave.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>icps <command>cps2pch</command> ipch, iequal</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ipch</emphasis> -- Input number of the form 8ve.pc, indicating an 'octave' and which note in the octave.
    </para>

    <para>
      <emphasis>iequal</emphasis> -- if positive, the number of equal intervals into which the 'octave' is divided. Must be less than or equal to 100. If negative, is the number of a table of frequency multipliers.
    </para>

    <note>
      <title>Note</title>
      <para>
        <orderedlist>
          <listitem>
            <para>The following are essentially the same
            <literallayout>
ia  =  <emphasis>cpspch</emphasis>(8.02)
ib     <emphasis>cps2pch</emphasis>  8.02, 12
ic     <emphasis>cpsxpch</emphasis>  8.02, 12, 2, 1.02197503906
            </literallayout>
            </para>
          </listitem>

          <listitem>
            <para>
              These are opcodes not functions
            </para>
          </listitem>

	  <listitem>
            <para>
              Negative values of <emphasis>ipch</emphasis> are allowed.
            </para>
          </listitem>
        </orderedlist>
      </para>
    </note>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the cps2pch opcode. It uses the files <ulink url="examples/cps2pch.orc"><citetitle>cps2pch.orc</citetitle></ulink> and <ulink url="examples/cps2pch.sco"><citetitle>cps2pch.sco</citetitle></ulink>.

      <example>
        <title>Example of the cps2pch opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cps2pch.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cps2pch.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Its output should include lines like this:
      <screen>
instr 1:  icps = 293.666
      </screen>
    </para>

    <para>
      Here is an example of the cps2pch opcode using a table of frequency multipliers. It uses the files <ulink url="examples/cps2pch_ftable.orc"><citetitle>cps2pch_ftable.orc</citetitle></ulink> and <ulink url="examples/cps2pch_ftable.sco"><citetitle>cps2pch_ftable.sco</citetitle></ulink>.

      <example>
        <title>Example of the cps2pch opcode using a table of frequency multipliers.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cps2pch_ftable.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cps2pch_ftable.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Its output should include lines like this:
      <screen>
instr 1:  icps = 313.951
      </screen>
    </para>

    <para>
      Here is an example of the cps2pch opcode using a 19ET scale. It uses the files <ulink url="examples/cps2pch_19et.orc"><citetitle>cps2pch_19et.orc</citetitle></ulink> and <ulink url="examples/cps2pch_19et.sco"><citetitle>cps2pch_19et.sco</citetitle></ulink>.

      <example>
        <title>Example of the cps2pch opcode using a 19ET scale.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cps2pch_19et.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cps2pch_19et.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Its output should include lines like this:
      <screen>
instr 1:  icps = 281.429
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="cpspch"><citetitle>cpspch</citetitle></link>, 
      <link linkend="cpsxpch"><citetitle>cpsxpch</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath/Codemist Ltd.</member>
        <member>Bath, UK</member>
        <member>1997</member>
      </simplelist>
    </para>

    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>1998</member>
      </simplelist>
    </para>

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