-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.scd
65 lines (58 loc) · 1.2 KB
/
main.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
57
58
59
60
61
62
63
64
65
(
var main = { | server, sample_paths |
var load_timeout = 9;
var loaded = Set[];
var buffers = sample_paths.collect({ | relative_homedir_path |
var path = (
// Platform.userHomeDir +/+
relative_homedir_path
);
Buffer.read(server, path, action: { |buffer|
("好" + relative_homedir_path ).postln;
loaded.add(buffer);
});
});
var thread = fork {
loop {
if (loaded.size > 0) {
var synth = Synth.new("wdj", [ \bufnum, loaded.pop() ]);
synth.postln;
} {
1.wait;
};
}
};
server.record;
load_timeout.wait;
thread.stop;
"done".postln;
};
s.waitForBoot({
var wdj = SynthDef(\wdj, { |
out = 0,
bufnum,
//rate = 1.0,
startPos = 234800,
loop = 0.0 |
var trig = Impulse.kr(XLine.kr(0.1, 6, 30));
var rate = XLine.kr(1, 12, 30);
//var rate = LFNoise2.kr(800).range(0.1,10);
var sound = PlayBuf.ar(
numChannels: 2,
bufnum: bufnum,
rate: BufRateScale.kr(bufnum) * rate,
trigger: trig,
startPos: startPos,
loop: loop
);
startPos.postln;
Out.ar(out, sound);
});
wdj.add;
main.value(s, [
//"path/relative/toHomeDir.wav"
"/Users/sofokliskoutsourelis/Desktop/PALLADOS guns_out_2d_2b_amp.aiff"
]);
});
)
Server.default.stopRecording;