<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="wrap">
  <refmeta>
    <refentrytitle>wrap</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>wrap</refname>
    <refpurpose>
      Wraps-around the signal that exceeds the low and high thresholds.
      <indexterm id="IndexWrap"><primary>wrap</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Wraps-around the signal that exceeds the low and high thresholds.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>wrap</command> asig, klow, khigh</synopsis>

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

    <synopsis>kr <command>wrap</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>wrap</emphasis> wraps-around the signal that exceeds the low and high thresholds.
    </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. <emphasis>wrap</emphasis> is also useful for wrap-around of table data when the maximum index is not a power of two (see <link linkend="table"><citetitle>table</citetitle></link> and <link linkend="tablei"><citetitle>tablei</citetitle></link>). Another use of <emphasis>wrap</emphasis> is in cyclical event repeating, with arbitrary cycle length.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="limit"><citetitle>limit</citetitle></link>,
      <link linkend="mirror"><citetitle>mirror</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
      </simplelist>
    </para>

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