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

    <refpurpose>
      Performs a logarithmic base two calculation.
      <indexterm id="IndexLogbtwo"><primary>logbtwo</primary></indexterm>
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Performs a logarithmic base two calculation.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>logbtwo</command>(x)  (init-rate or control-rate args only)</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>logbtwo</emphasis>() returns the logarithm base two of <emphasis>x</emphasis>. The range of values admitted as argument is .25 to 4 (i.e. from -2 octave to +2 octave response). This function is the inverse of <emphasis>powoftwo</emphasis>().
    </para>

    <para>
      These functions are fast, because they read values stored in tables. Also they are very useful when working with tuning ratios. They work at i- and k-rate.
    </para>
  </refsect1>

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

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

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

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

      Its output should include a line like this:
      <screen>
instr 1:  i1 = 1.585
      </screen>
    </para>
  </refsect1>
 
  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="powoftwo"><citetitle>powoftwo</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>June 1998</member>
      </simplelist>
    </para>

    <para>
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath, Codemist, Ltd.</member>
        <member>Bath, UK</member>
        <member>July 1999</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

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