File: BufDelayC.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (68 lines) | stat: -rw-r--r-- 1,683 bytes parent folder | download | duplicates (6)
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
class:: BufDelayC
summary:: Buffer based simple delay line with cubic interpolation.
related:: Classes/BufDelayL, Classes/BufDelayN, Classes/DelayC
categories::  UGens>Delays>Buffer


Description::

Simple delay line with cubic interpolation which uses a buffer for its
internal memory. See also  link::Classes/BufDelayN::  which uses no
interpolation, and  link::Classes/BufDelayL::  which uses linear
interpolation. Cubic interpolation is more computationally expensive
than linear, but more accurate.


classmethods::

method::ar, kr

argument::buf
Buffer number.

note:: The buffers provided to any of the BufDelay units must be one channel. If you want to delay a multichannel signal, you must provide as many separate (one-channel) buffers as there are input channels.::

argument::in
The input signal.

argument::delaytime
Delay time in seconds.

discussion::
Warning:: For reasons of efficiency, the effective buffer size is limited to the previous power of two. So, if 44100 samples are allocated, the maximum delay would be 32768 samples.
::

Examples::

code::

// allocate buffer
b = Buffer.alloc(s,44100,1);

(
// Dust randomly triggers Decay to create an exponential
// decay envelope for the WhiteNoise input source
{
z = Decay.ar(Dust.ar(1,0.5), 0.3, WhiteNoise.ar);
BufDelayC.ar(b.bufnum, z, 0.2, 1, z); // input is mixed with delay via the add input
}.play
)

b.free;


// multichannel

// two channels, two buffers
b = Buffer.allocConsecutive(2, s, 32768, 1);

a = { |bufs = #[0, 1]|
	var sig = SinOsc.ar([440, 880]) * Decay2.kr(Impulse.kr([2, 4]), 0.01, 0.15);
	sig + BufDelayC.ar(bufs, sig, delaytime: 0.125)
}.play(args: [bufs: b]);

a.free;
b.do(_.free);

::