| 1 | |
| 2 | <refentry id="wrap"> |
| 3 | <indexterm id="IndexWrap"><primary>wrap</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Signal Limiters</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>wrap</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>wrap</refname> |
| 13 | <refpurpose> |
| 14 | Wraps-around the signal that exceeds the low and high thresholds. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Wraps-around the signal that exceeds the low and high thresholds. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>wrap</command> asig, klow, khigh</synopsis> |
| 28 | |
| 29 | <synopsis>ires <command>wrap</command> isig, ilow, ihigh</synopsis> |
| 30 | |
| 31 | <synopsis>kres <command>wrap</command> ksig, klow, khigh</synopsis> |
| 32 | </refsect1> |
| 33 | |
| 34 | <refsect1> |
| 35 | <title>Initialization</title> |
| 36 | <para> |
| 37 | <emphasis>isig</emphasis> -- input signal |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>ilow</emphasis> -- low threshold |
| 42 | </para> |
| 43 | |
| 44 | <para> |
| 45 | <emphasis>ihigh</emphasis> -- high threshold |
| 46 | </para> |
| 47 | </refsect1> |
| 48 | |
| 49 | <refsect1> |
| 50 | <title>Performance</title> |
| 51 | <para> |
| 52 | <emphasis>xsig</emphasis> -- input signal |
| 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | <emphasis>klow</emphasis> -- low threshold |
| 57 | </para> |
| 58 | |
| 59 | <para> |
| 60 | <emphasis>khigh</emphasis> -- high threshold |
| 61 | </para> |
| 62 | |
| 63 | <para> |
| 64 | <emphasis>wrap</emphasis> wraps-around the signal that exceeds the low and high thresholds. |
| 65 | </para> |
| 66 | |
| 67 | <para> |
| 68 | 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. |
| 69 | </para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Examples</title> |
| 74 | <para> |
| 75 | Here is an example of the wrap opcode. It uses the file <ulink url="examples/wrap.csd"><citetitle>wrap.csd</citetitle></ulink>. |
| 76 | <example> |
| 77 | <title>Example of the wrap opcode.</title> |
| 78 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 79 | <xi:include href="examples-xml/wrap.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 80 | </example> |
| 81 | </para> |
| 82 | </refsect1> |
| 83 | |
| 84 | <refsect1> |
| 85 | <title>See also</title> |
| 86 | <para><link linkend="SigmodSiglimit"><citetitle>Signal Limiters</citetitle></link></para> |
| 87 | </refsect1> |
| 88 | |
| 89 | <refsect1> |
| 90 | <title>Credits</title> |
| 91 | <para> |
| 92 | <simplelist> |
| 93 | <member>Author: &namegabriel;</member> |
| 94 | <member>Italy</member> |
| 95 | </simplelist> |
| 96 | </para> |
| 97 | |
| 98 | <para>New in Csound version 3.49</para> |
| 99 | </refsect1> |
| 100 | </refentry> |