| 1 | |
| 2 | <refentry id="deltap"> |
| 3 | <indexterm id="IndexDeltap"><primary>deltap</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Delay</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>deltap</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>deltap</refname> |
| 11 | <refpurpose> |
| 12 | Taps a delay line at variable offset times. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Tap a delay line at variable offset times. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>ares <command>deltap</command> kdlt</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Performance</title> |
| 30 | <para> |
| 31 | <emphasis>kdlt</emphasis> -- specifies the tapped delay time in seconds. Each can range from 1 control period to the full delay time of the read/write pair; however, since there is no internal check for adherence to this range, the user is wholly responsible. Each argument can be a constant, a variable, or a time-varying signal. |
| 32 | </para> |
| 33 | |
| 34 | <para> |
| 35 | <emphasis>deltap</emphasis> extracts sound by reading the stored samples directly. |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | This opcode can tap into a <link linkend="delayr"><citetitle>delayr</citetitle></link>/<link linkend="delayw"><citetitle>delayw</citetitle></link> pair, extracting delayed audio from the <emphasis>idlt</emphasis> seconds of stored sound. There can be any number of <emphasis>deltap</emphasis> and/or <link linkend="deltapi"><citetitle>deltapi</citetitle></link> units between a read/write pair. Each receives an audio tap with no change of original amplitude. |
| 40 | </para> |
| 41 | |
| 42 | <para> |
| 43 | This opcode can provide multiple delay taps for arbitrary delay path and feedback networks. They can deliver either constant-time or time-varying taps, and are useful for building chorus effects, harmonizers, and Doppler shifts. Constant-time delay taps (and some slowly changing ones) do not need interpolated readout; they are well served by <emphasis>deltap</emphasis>. Medium-paced or fast varying dlt's, however, will need the extra services of <emphasis>deltapi</emphasis>. |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | <emphasis>delayr</emphasis>/<emphasis>delayw</emphasis> pairs may be interleaved. To associate a delay tap unit with a specific <emphasis>delayr</emphasis> unit, it not only has to be located between that <emphasis>delayr</emphasis> and the appropriate <emphasis>delayw</emphasis> unit, but must also precede any following <emphasis>delayr</emphasis> units. See Example 2. (This feature added in Csound version 3.57 by Jens Groh and &namejohn;). |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | <emphasis>N.B.</emphasis> k-rate delay times are not internally interpolated, but rather lay down stepped time-shifts of audio samples; this will be found quite adequate for slowly changing tap times. For medium to fast-paced changes, however, one should provide a higher resolution audio-rate timeshift as input. |
| 52 | </para> |
| 53 | </refsect1> |
| 54 | |
| 55 | <refsect1> |
| 56 | <title>Examples</title> |
| 57 | <para> |
| 58 | <example> |
| 59 | <title>deltap example #1</title> |
| 60 | <programlisting> |
| 61 | asource <emphasis role="opc">buzz</emphasis> 1, 440, 20, 1 |
| 62 | atime <emphasis role="opc">linseg</emphasis> 1, p3<emphasis role="op">/</emphasis>2,.01, p3<emphasis role="op">/</emphasis>2,1 <emphasis role="comment">; trace a distance in secs</emphasis> |
| 63 | ampfac <emphasis role="op">=</emphasis> 1<emphasis role="op">/</emphasis>atime<emphasis role="op">/</emphasis>atime <emphasis role="comment">; and calc an amp factor</emphasis> |
| 64 | adump <emphasis role="opc">delayr</emphasis> 1 <emphasis role="comment">; set maximum distance</emphasis> |
| 65 | amove <emphasis role="opc">deltapi</emphasis> atime <emphasis role="comment">; move sound source past</emphasis> |
| 66 | <emphasis role="opc">delayw</emphasis> asource <emphasis role="comment">; the listener</emphasis> |
| 67 | <emphasis role="opc">out</emphasis> amove <emphasis role="op">*</emphasis> ampfac</programlisting> |
| 68 | </example> |
| 69 | </para> |
| 70 | |
| 71 | <para> |
| 72 | <example> |
| 73 | <title>deltap example #2</title> |
| 74 | <programlisting> |
| 75 | ainput1 <emphasis role="op">=</emphasis> ..... |
| 76 | ainput2 <emphasis role="op">=</emphasis> ..... |
| 77 | kdlyt1 <emphasis role="op">=</emphasis> ..... |
| 78 | kdlyt2 <emphasis role="op">=</emphasis> ..... |
| 79 | |
| 80 | <emphasis role="comment">;Read delayed signal, first delayr instance:</emphasis> |
| 81 | adump <emphasis role="opc">delayr</emphasis> 4.0 |
| 82 | adly1 <emphasis role="opc">deltap</emphasis> kdlyt1 <emphasis role="comment">; associated with first delayr instance</emphasis> |
| 83 | |
| 84 | <emphasis role="comment">;Read delayed signal, second delayr instance:</emphasis> |
| 85 | adump <emphasis role="opc">delayr</emphasis> 4.0 |
| 86 | adly2 <emphasis role="opc">deltap</emphasis> kdlyt2 <emphasis role="comment">; associated with second delayr instance</emphasis> |
| 87 | |
| 88 | <emphasis role="comment">;Do some cross-coupled manipulation:</emphasis> |
| 89 | afdbk1 <emphasis role="op">=</emphasis> 0.7 <emphasis role="op">*</emphasis> adly1 <emphasis role="op">+</emphasis> 0.7 <emphasis role="op">*</emphasis> adly2 <emphasis role="op">+</emphasis> ainput1 |
| 90 | afdbk2 <emphasis role="op">=</emphasis> -0.7 <emphasis role="op">*</emphasis> adly1 <emphasis role="op">+</emphasis> 0.7 <emphasis role="op">*</emphasis> adly2 <emphasis role="op">+</emphasis> ainput2 |
| 91 | |
| 92 | <emphasis role="comment">;Feed back signal, associated with first delayr instance:</emphasis> |
| 93 | <emphasis role="opc">delayw</emphasis> afdbk1 |
| 94 | |
| 95 | <emphasis role="comment">;Feed back signal, associated with second delayr instance:</emphasis> |
| 96 | <emphasis role="opc">delayw</emphasis> afdbk2 |
| 97 | <emphasis role="opc">outs</emphasis> adly1, adly2</programlisting> |
| 98 | </example> |
| 99 | </para> |
| 100 | |
| 101 | <para> |
| 102 | Here is yet another example of the deltap opcode. It uses the file <ulink url="examples/deltap.csd"><citetitle>deltap.csd</citetitle></ulink>. |
| 103 | |
| 104 | <example> |
| 105 | <title>Example of the deltap opcode.</title> |
| 106 | |
| 107 | <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> |
| 108 | <xi:include href="examples-xml/deltap.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 109 | </example> |
| 110 | </para> |
| 111 | </refsect1> |
| 112 | |
| 113 | <refsect1> |
| 114 | <title>See also</title> |
| 115 | <para><link linkend="SigmodDelay"><citetitle>Delay</citetitle></link></para> |
| 116 | </refsect1> |
| 117 | |
| 118 | </refentry> |