-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcool-synth.sc
64 lines (46 loc) · 1.05 KB
/
cool-synth.sc
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
(
var lead = SynthDef(\cool_lead, {
arg out, freq, amp = 1, dur = 2;
var env = EnvGen.ar(Env.new([1, 0], [dur], \lin));
var glideEnv = EnvGen.ar(Env.new([1.2, 1], [dur/12], \exp));
var sig = amp * env * LFSaw.ar(freq * glideEnv);
Out.ar(out, sig);
});
var delay = SynthDef(\cool_delay, {
arg in, out, dt = 1000, fb = 0.2;
var seconds = dt/1000;
var sig = In.ar(in);
var local = fb * LocalIn.ar(1);
var wet = AllpassL.ar(sig + local, seconds * 8, seconds, 3);
LocalOut.ar(wet);
Out.ar(out, wet);
});
var mixer = SynthDef(\cool_mixer, {
arg in=99, out=0, mix=0.5;
Out.ar(out, mix * In.ar(in, 1));
});
var buses = Array.fill(8, { Bus.audio(Server.default) });
lead.add;
mixer.add;
delay.add;
c = Synth.new(\cool_mixer, [
\in, buses[4],
\out, 0,
\mix, 1/4
]);
b=Synth.new(\cool_delay, [
\in, buses[0],
\out, buses[4]
]);
a= Synth.new(\cool_mixer, [
\in, buses[0],
\out, 0,
\mix, 1/2
]);
Pbindef(\lead,
\instrument, \cool_lead,
\out, buses[0],
\midinote, Prand(60 + Scale.minor.degrees, inf),
\dur, Pshuf([1/3, 1/2, 1], inf)
).play;
)