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

  <refnamediv>
    <refname>semitone</refname>
    <refpurpose>
      Calculates a factor to raise/lower a frequency by a given amount of semitones.
      <indexterm id="IndexSemitone"><primary>semitone</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Calculates a factor to raise/lower a frequency by a given amount of semitones.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>semitone</command>(x)</synopsis>

    <para>
      This function works at a-rate, i-rate, and k-rate.
    </para>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>x</emphasis> -- a value expressed in semitones.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      The value returned by the <emphasis>semitone</emphasis> function is a factor. You can multiply a frequency by this factor to raise/lower it by the given amount of semitones.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the semitone opcode. It uses the files <ulink url="examples/semitone.orc"><citetitle>semitone.orc</citetitle></ulink> and <ulink url="examples/semitone.sco"><citetitle>semitone.sco</citetitle></ulink>.

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

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

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

      Its output should include lines like:
      <screen>
instr 1:  iroot = 440.000
instr 1:  ifactor = 1.189
instr 1:  inew = 523.229
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="cent"><citetitle>cent</citetitle></link>,
      <link linkend="db"><citetitle>db</citetitle></link>,
      <link linkend="octave"><citetitle>octave</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
    <para>New in version 4.16</para>
  </refsect1>
</refentry>
