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

    <refpurpose>
      Maintains the output equal to the highest absolute value received.
      <indexterm id="IndexPeak"><primary>peak</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      These opcodes maintain the output k-rate variable as the peak absolute level so far received.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>kr <command>peak</command> asig</synopsis>

    <synopsis>kr <command>peak</command> ksig</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kr</emphasis> -- Output equal to the highest absolute value received so far. This is effectively an input to the opcode as well, since it reads <emphasis>kr</emphasis> in order to decide whether to write something higher into it.
    </para>

    <para>
      <emphasis>ksig </emphasis> -- k-rate input signal.
    </para>

    <para>
      <emphasis>asig </emphasis> -- a-rate input signal.
    </para>
  </refsect1>

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

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

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

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

      Its output should include lines like this:
      <screen>
 i   1 time     0.00002:  4835.00000
 i   1 time     1.00002: 29312.00000
 i   1 time     2.00002: 32767.00000
      </screen>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Robin Whittle</member>
        <member>Australia</member>
        <member>May 1997</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
