<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="limit">
  <refmeta>
    <refentrytitle>limit</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>limit</refname>
    <refpurpose>
      Sets the lower and upper limits of the value it processes.
      <indexterm id="IndexLimit"><primary>limit</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Sets the lower and upper limits of the value it processes.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>limit</command> asig, klow, khigh</synopsis>

    <synopsis>ir <command>limit</command> isig, ilow, ihigh</synopsis>

    <synopsis>kr <command>limit</command> ksig, klow, khigh</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>isig</emphasis> -- input signal
    </para>

    <para>
      <emphasis>ilow</emphasis> -- low threshold
    </para>

    <para>
      <emphasis>ihigh</emphasis> -- high threshold
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>xsig</emphasis> -- input signal
    </para>

    <para>
      <emphasis>klow</emphasis> -- low threshold
    </para>

    <para>
      <emphasis>khigh</emphasis> -- high threshold
    </para>

    <para>
      <emphasis>limit</emphasis> sets the lower and upper limits on the <emphasis>xsig</emphasis> value it processes. If <emphasis>xhigh</emphasis> is lower than <emphasis>xlow</emphasis>, then the output will be the average of  the two - it will not be affected by <emphasis>xsig</emphasis>.
    </para>

    <para>
      This opcode is useful in several situations, such as table indexing or for clipping and modeling a-rate, i-rate or k-rate signals.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="mirror"><citetitle>mirror</citetitle></link>,
      <link linkend="wrap"><citetitle>wrap</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Robin Whittle</member>
        <member>Australia</member>
      </simplelist>
    </para>

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