| 1 | |
| 2 | <refentry id="interp"> |
| 3 | <indexterm id="IndexInterp"><primary>interp</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Sample Level Operators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>interp</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>interp</refname> |
| 13 | <refpurpose> |
| 14 | Converts a control signal to an audio signal using linear interpolation. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Converts a control signal to an audio signal using linear interpolation. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>interp</command> ksig [, iskip] [, imode] |
| 28 | [, ivalue]</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Initialization</title> |
| 33 | <para> |
| 34 | <emphasis>iskip</emphasis> (optional, default=0) -- if non zero |
| 35 | skips initialisation of internal save space (see <link linkend="reson"><citetitle>reson</citetitle></link>). |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | <emphasis>imode</emphasis> (optional, default=0) -- sets the initial output value to the first k-rate input instead of zero. The following graphs show the output of interp with a constant input value, in the original, when skipping init, and in the new mode: |
| 40 | |
| 41 | <example> |
| 42 | <title>iskip=0, imode=0</title> |
| 43 | <literallayout> |
| 44 | | ________ |
| 45 | | / |
| 46 | | / |
| 47 | | / |
| 48 | |/ |
| 49 | -+------------ |
| 50 | | |
| 51 | </literallayout> |
| 52 | </example> |
| 53 | |
| 54 | <example> |
| 55 | <title>iskip=1, imode=0</title> |
| 56 | <literallayout> |
| 57 | (prev) |
| 58 | | __________ |
| 59 | | / |
| 60 | |/ |
| 61 | | |
| 62 | | |
| 63 | -+------------ |
| 64 | | |
| 65 | </literallayout> |
| 66 | </example> |
| 67 | |
| 68 | <example> |
| 69 | <title>iskip=0, imode=1</title> |
| 70 | <literallayout> |
| 71 | |____________ |
| 72 | | |
| 73 | | |
| 74 | | |
| 75 | | |
| 76 | -+------------ |
| 77 | | |
| 78 | </literallayout> |
| 79 | </example> |
| 80 | </para> |
| 81 | <para> |
| 82 | <emphasis>ivalue</emphasis> (optional, default=0) -- initial |
| 83 | value if both imode and iskip are zero. |
| 84 | </para> |
| 85 | </refsect1> |
| 86 | |
| 87 | <refsect1> |
| 88 | <title>Performance</title> |
| 89 | <para> |
| 90 | <emphasis>ksig</emphasis> -- input k-rate signal. |
| 91 | </para> |
| 92 | |
| 93 | <para> |
| 94 | <emphasis>interp</emphasis> converts a control signal to an audio signal. It uses linear interpolation between successive kvals. |
| 95 | </para> |
| 96 | </refsect1> |
| 97 | |
| 98 | <refsect1> |
| 99 | <title>Examples</title> |
| 100 | <para> |
| 101 | Here is an example of the interp opcode. It uses the file <ulink url="examples/interp.csd"><citetitle>interp.csd</citetitle></ulink>. |
| 102 | |
| 103 | <example> |
| 104 | <title>Example of the interp opcode.</title> |
| 105 | <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> |
| 106 | <xi:include href="examples-xml/interp.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 107 | </example> |
| 108 | </para> |
| 109 | </refsect1> |
| 110 | |
| 111 | <refsect1> |
| 112 | <title>See also</title> |
| 113 | <para><link linkend="SigmodSample"><citetitle>Sample Level Operators</citetitle></link></para> |
| 114 | <para> More information on this opcode: <ulink url="https://csoundjournal.com/issue10/CsoundRates.html"><citetitle>Csound Journal, issue10 - An Overview of Csound Variable Types</citetitle></ulink>, written by Andrés Cabrera </para> |
| 115 | </refsect1> |
| 116 | |
| 117 | <refsect1> |
| 118 | <title>Credits</title> |
| 119 | <para>Updated November 2002, thanks to a note from both &namerasmus; and &nameistvan;.</para> |
| 120 | </refsect1> |
| 121 | </refentry> |