File: DelTapWr.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 (75 lines) | stat: -rw-r--r-- 2,100 bytes parent folder | download | duplicates (4)
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
class:: DelTapWr
categories:: UGens>Buffer, UGens>Delays
summary:: Write to a buffer for a DelTapRd UGen
related:: Classes/DelTapRd

description::
Write to a buffer for a link::Classes/DelTapRd:: UGen.

note:: If you run a code::DelTapRd.ar:: and a code::DelTapWr.ar:: in tandem, keep in mind that they read and write in blocks
equal to the server's block size. If the delay time is greater than the buffer size minus a block, the write and read
heads might interfere in unintended ways. Use a slightly larger buffer if this happens. ::

classmethods::
private:: categories

method:: ar, kr
argument:: buffer
the buffer to write signal into. Max delay time is based on buffer size.
argument:: in
the signal to write to the buffer.
returns::
phase - DelTapWr outputs its current sample value for use in the phase argument in DelTapRd

examples::
code::
// a Buffer for the UGens to use, one second at the current sample rate
b = Buffer.alloc(s, s.sampleRate * 1, 1);

// write a signal into a delay, tap it at multiple times
SynthDef(\test, { |out, buffer|
	var src, tapPhase, tap1, tap2, tap3;
	src = WhiteNoise.ar(0.2) * Decay.kr(Dust.kr(3), 0.2);
	tapPhase = DelTapWr.ar(buffer, src);
	#tap1, tap2, tap3 = DelTapRd.ar(buffer, tapPhase,
		[0.2, 0.27, 0.303],  	// tap times
		1,  					// no interp
		[1.0, 0.4, 0.2] 		// muls for each tap
	);
	Out.ar(out, [src + tap2, tap1 + tap3])
}).add;

x = Synth(\test, [\buffer, b]);
x.free;
b.free;
::

code::
// a Buffer for the UGens to use
b = Buffer.alloc(s, 44100, 1);

// write a signal into a delay, tap it at multiple times
SynthDef(\write, { |buffer, cout|
	var src, tapPhase, tap1, tap2, tap3;
	src = WhiteNoise.ar(0.2) * Decay.kr(Dust.kr(3), 0.7);
	tapPhase = DelTapWr.ar(buffer, src);
	Out.kr(cout, tapPhase);
	}).add;

SynthDef(\readFilt, { |out, buffer, cin|
	var phase, src, filt;
	phase = In.kr(cin);
	src = DelTapRd.ar(buffer, phase, [0.01, 0.2]);
	filt = BPF.ar(src, 880, 0.01) * 10;
	Out.ar(out, filt);
}).add;

c = Bus.control;

x = Synth(\write, [\buffer, b, \cout, c]);
y = Synth(\readFilt, [\buffer, b, \cin, c]);

x.free;
b.free;
::