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

    <refpurpose>
       Converts a pitch-class value into cycles-per-second (Hz) for equal divisions of any interval.
      <indexterm id="IndexCpsxpch"><primary>cpsxpch</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Converts a pitch-class value into cycles-per-second (Hz) for equal divisions of any interval. There is a restriction of no more than 100 equal divisions.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>icps <command>cpsxpch</command> ipch, iequal, irepeat, ibase</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>

    <para>
      <emphasis>irepeat</emphasis> -- Number indicating the interval which is the 'octave.' The integer 2 corresponds to octave divisions, 3 to a twelfth, 4 is two octaves, and so on. This need not be an integer, but must be positive.
    </para>

    <para>
      <emphasis>ibase</emphasis> -- The frequency which corresponds to pitch 0.0
    </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, but not negative <emphasis>irepeat</emphasis>, <emphasis>iequal</emphasis> or <emphasis>ibase</emphasis>.
            </para>
          </listitem>
        </orderedlist>
      </para>
    </note>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the cpsxpch opcode. It uses the files <ulink url="examples/cpsxpch.orc"><citetitle>cpsxpch.orc</citetitle></ulink> and <ulink url="examples/cpsxpch.sco"><citetitle>cpsxpch.sco</citetitle></ulink>.

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

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

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/cpsxpch.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 cpsxpch opcode using a 10.5 ET scale. It uses the files <ulink url="examples/cpsxpch_105et.orc"><citetitle>cpsxpch_105et.orc</citetitle></ulink> and <ulink url="examples/cpsxpch_105et.sco"><citetitle>cpsxpch_105et.sco</citetitle></ulink>.

      <example>
        <title>Example of the cpsxpch opcode using a 10.5 ET scale.</title>

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

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

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

    <para>
      Here is an example of the cpsxpch opcode using a Pierce scale centered on middle A. It uses the files <ulink url="examples/cpsxpch_pierce.orc"><citetitle>cpsxpch_pierce.orc</citetitle></ulink> and <ulink url="examples/cpsxpch_pierce.sco"><citetitle>cpsxpch_pierce.sco</citetitle></ulink>.

      <example>
        <title>Example of the cpsxpch opcode using a Pierce scale centered on middle A.</title>

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

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

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

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="cpspch"><citetitle>cpspch</citetitle></link>,
      <link linkend="cps2pch"><citetitle>cps2pch</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>
