summaryrefslogtreecommitdiff
path: root/opcodes/deltapn.xml
blob: 2b089d697604be2559cbda39f77606a444de26d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<refentry id="deltapn">
<indexterm id="IndexDeltapn"><primary>deltapn</primary></indexterm>
  <refentryinfo><title>Signal Modifiers:Delay</title></refentryinfo>
  <refmeta>
    <refentrytitle>deltapn</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>deltapn</refname>
    <refpurpose>
      Taps a delay line at variable offset times.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Tap a delay line at variable offset times. 
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>deltapn</command> xnumsamps</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>xnumsamps</emphasis> -- specifies the tapped delay time in number of samples. 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.
    </para>

    <para>
      <emphasis>deltapn</emphasis> is identical to <link linkend="deltapi"><citetitle>deltapi</citetitle></link>, except delay time is specified in number of samples, instead of seconds (&namehans;).
    </para>

    <para>
      This opcode can tap into a <emphasis>delayr</emphasis>/<emphasis>delayw</emphasis> pair, extracting delayed audio from the <emphasis>idlt</emphasis> seconds of stored sound. There can be any number of <emphasis>deltap</emphasis> and/or <emphasis>deltapi</emphasis> units between a read/write pair. Each receives an audio tap with no change of original amplitude.
    </para>

    <para>
      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>.
    </para>

    <para>
      <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;).
    </para>

    <para>
      <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.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      <example>
        <title>deltap example #1</title>
        <programlisting>
  asource  <emphasis>buzz</emphasis>      1, 440, 20, 1
  atime    <emphasis>linseg</emphasis>    1, p3/2,.01, p3/2,1   ; trace a distance in secs
  ampfac   <emphasis>=</emphasis>         1/atime/atime         ; and calc an amp factor
  adump    <emphasis>delayr</emphasis>    1                     ; set maximum distance
  amove    <emphasis>deltapi</emphasis>   atime                 ; move sound source past
           <emphasis>delayw</emphasis>    asource               ; the listener
           <emphasis>out</emphasis>       amove * ampfac
        </programlisting>
      </example>
    </para>

    <para>
      <example>
        <title>deltap example #2</title>
        <programlisting>
  ainput1 =	..... 
  ainput2 =	..... 
  kdlyt1  =	..... 
  kdlyt2  =	..... 

;Read delayed signal, first delayr instance:
  adump   <emphasis>delayr</emphasis>  4.0 
  adly1   <emphasis>deltap</emphasis>  kdlyt1       ;associated with first delayr instance 

;Read delayed signal, second delayr instance:
  adump   <emphasis>delayr</emphasis>  4.0 
  adly2   <emphasis>deltap</emphasis>  kdlyt2       ; associated with second delayr instance 

;Do some cross-coupled manipulation: 
  afdbk1  =       0.7 * adly1 + 0.7 * adly2 + ainput1 
  afdbk2  =       -0.7 * adly1 + 0.7 * adly2 + ainput2 

;Feed back signal, associated with first delayr instance: 
          <emphasis>delayw</emphasis>  afdbk1 

;Feed back signal, associated with second delayr instance: 
          <emphasis>delayw</emphasis>  afdbk2
          <emphasis>outs</emphasis>    adly1, adly2
        </programlisting>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="deltap"><citetitle>deltap</citetitle></link>,
      <link linkend="deltap3"><citetitle>deltap3</citetitle></link>,
      <link linkend="deltapi"><citetitle>deltapi</citetitle></link>
    </para>
  </refsect1>
</refentry>