-
Notifications
You must be signed in to change notification settings - Fork 6
/
CaosPad2.sc
66 lines (43 loc) · 1.46 KB
/
CaosPad2.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
65
66
//written by @joseCao5
//Pad of trippy ambience
//Part of CaosPercLib 1.1
CaosPad2 :CaosEnv {
*new {
^super.new;
}
*ar {|att=0.5,rel=2,note=60,maxNote=60,fm=0.125,harm=1,gate=1,amp1=0.5,amp2=0.5,pan=0,doneAction=2|
var sig,env;
sig = this.signal(att,rel,note,maxNote,fm,harm,gate,amp1,amp2);
sig = this.comp(sig);
env = this.envKR(att,rel,gate,doneAction);
^Pan2.ar(sig,pan);
}
ar {|att=0.5,rel=2,note=60,maxNote=60,fm=0.125,harm=1,gate=1,amp1=0.5,amp2=0.5,pan=0,doneAction=2|
var sig,env;
sig = this.signal(att,rel,note,maxNote,fm,harm,gate,amp1,amp2);
sig = this.comp(sig);
env = this.envKR(att,rel,gate,doneAction);
^Pan2.ar(sig*env,pan);
}
*robot {|att=0.5,rel=2,note=220,maxNote=60,fm=0.125,harm=1,amp1=0.5,amp2=0.5,pan=0,t=0.25,tp=0,doneAction=0|
var sig,env;
sig = this.signal(att,rel,note,maxNote,fm,harm,amp1,amp2);
sig = this.comp(sig);
env = this.envKR(att,rel,Impulse.kr(t,tp),doneAction);
^Pan2.ar(sig*env,pan);
}
*signal {|att,rel,note,maxNote,fm,harm,amp1,amp2|
var sig1,sig2,notes;
notes=[note,maxNote].midicps;
sig1=SinOsc.ar(Pulse.kr(fm,0.25,notes[0],notes[1]),0,amp1/4);
sig2=Blip.ar(Blip.ar(fm,harm/3,notes[0],notes[1]),harm,amp2/4);
^sig1*sig2;
}
signal {|att,rel,note,maxNote,fm,harm,amp1,amp2|
var sig1,sig2,notes;
notes=[note,maxNote].midicps;
sig1=SinOsc.ar(Pulse.kr(fm,0.25,notes[0],notes[1]),0,amp1/4);
sig2=Blip.ar(Blip.ar(fm,harm/3,notes[0],notes[1]),harm,amp2/4);
^sig1*sig2;
}
}