-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathugensynthdefs.sc
More file actions
64 lines (55 loc) · 1.69 KB
/
Copy pathugensynthdefs.sc
File metadata and controls
64 lines (55 loc) · 1.69 KB
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
SynthDef("builder-clear", {
|out_bus|
ReplaceOut.ar(out_bus, 0);
}).store;
SynthDef("Ugen_SinOsc", {
|out_bus = 0, freq=440, phase=0, mul=1, add=0|
var out;
out = SinOsc.ar(freq, phase, mul, add);
Out.ar(out_bus, out);
}).store;
SynthDef("Ugen_Saw", {
|out_bus = 0, freq=440, mul=1, add=0|
var out;
out = Saw.ar(freq, mul, add);
Out.ar(out_bus, out);
}).store;
SynthDef("Ugen_LPF", {
|in_bus, out_bus = 0, freq=1000, mul=1, add=0|
var out, in;
in = In.ar(in_bus, 1);
out = LPF.ar(in, freq, mul, add);
Out.ar(out_bus, out);
}).store;
SynthDef("Ugen_Add", {
|in_bus, rhs, out_bus = 0|
var out, in_a;
in_a = In.ar(in_bus, 1);
out = in_a + rhs;
Out.ar(out_bus, out);
}).store;
SynthDef("Ugen_Mul", {
|in_bus, rhs, out_bus = 0|
var out, in_a;
in_a = In.ar(in_bus, 1);
out = in_a * rhs;
Out.ar(out_bus, out);
}).store;
SynthDef("Ugen_Env", {
|out_bus=0, attack=0.05, decay=0, sustain=1, release=0.2, mul=1, add=0, curve=0, gate=1, doneAction=14|
var out;
out = Env.adsr(attackTime:attack, decayTime:decay, sustainLevel:sustain, releaseTime:release, curve:curve);
out = EnvGen.kr(out, gate:gate, doneAction:doneAction);
out = out * mul;
out = out + add;
Out.kr(out_bus, out);
}).store;
SynthDef("Ugen_EnvPerc", {
|out_bus=0, attack=0, release=0.5, mul=1, curve=0, gate=1, doneAction=14|
var out;
out = Env.perc(attackTime:attack, releaseTime:release, curve:curve);
out = EnvGen.kr(out, gate:gate, doneAction:doneAction);
out = out * mul;
Out.kr(out_bus, out);
}).store;
0.exit;