-
Notifications
You must be signed in to change notification settings - Fork 1
/
Buffers.scd
56 lines (49 loc) · 847 Bytes
/
Buffers.scd
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
OSCFunc.trace(false);
Server.local.boot
(
OSCdef.new(
\thread0,
{
arg msg, time, addr, port;
x.set(\t_trig[1]);
},
'/0'
);
OSCdef.new(
\thread1,
{
arg msg, time, addr, port;
x.set(\t_trig[1]);
},
'/1'
);
OSCdef.new(
\thread11,
{
arg msg, time, addr, port;
x.set(\t_trig, msg[1]);
},
'/11'
);
)
~sounds = Array.new;
~folder = PathName.new("/Users/chrisfunk/Desktop/Sounds/");
(
~folder.entries.do( {
arg path;
~sounds = ~sounds.add(Buffer.read(s, path.fullPath));
} );
)
~sounds.at(0).play;
(
SynthDef.new(\playbuf_test, {
arg amp=1, out=0, buf, rate=1, t_trig=1, start=0, da=0;
var sig;
sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * rate, t_trig, start, doneAction:da);
sig = sig * amp;
Out.ar(out, sig);
} ).add;
)
x = Synth.new(\playbuf_test, [\buf, ~sounds[2].bufnum, \da, 0]);
x.set(\t_trig, 1);
x.free