-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2015-27-07-exrcs-rtm-001.clj
65 lines (56 loc) · 1.7 KB
/
2015-27-07-exrcs-rtm-001.clj
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
(defsynth time-machine
[tbus 0
cbus 0
rate 0]
(let [t (impulse:kr rate)
c (pulse-count:kr t)]
(out tbus t)
(out cbus c)))
(do
(defonce tbus1 (control-bus 1))
(defonce cbus1 (control-bus 1))
(def tm1 (time-machine :tbus tbus1
:cbus cbus1))
)
(defsynth kicka
[cbus 0
cmod 2
cdiv 1
coff 0
slen 20
]
(let [
;; master envelope of synth
m (env-gen (envelope [0 1 1 0] [4 (- slen 8) 4]) 1 1 0 1 FREE)
;; trigger processing from counting input bus
ti (in:kr cbus)
ti (= 0 (mod ti cmod))
ti (pulse-divider ti cdiv coff)
;; patterns
p1 (demand ti 0 (dseq [1 0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0] INF))
p2 (demand p1 0 (dseq [1900 400 1300 400 300 1500 2000 300] INF))
p3 (demand p1 0 (dseq [1 0 1 0 0 0 1 0 0 1] INF))
p4 (demand p1 0 (dseq [0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1] INF))
p5 (demand p3 0 (dseq [0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0] INF))
;; envelopes
fe (env-gen (perc 0 0.03 1 -10) p1 p2 40 1)
ae (env-gen (perc 0 0.3 1 -10) p1 1 0 1)
;; sounds
s1 (sin-osc-fb fe 0.4)
s (* s1 ae)
;;fxs
fx1 (comb-n (hpf (* p3 s) 2000) 2 1/8 0.49)
fx2 (comb-c (bpf (* p4 s) 800) 2 1/16 0.6)
fx3 (comb-l (rlpf (* p5 s) 1000 1.2)
2 1/2 0.7)
s (mix [s fx1 fx2 fx3])
s (wrap:ar s -0.15 0.15)
s (g-verb s 100 4 0.7)
s (normalizer s)
s (* m s)
]
(out 0 (pan2 s 0 0.2))))
(kill kicka)
(do ;(ctl tm1 :rate 32)
(def k1 (kicka :cbus cbus1 :cmod 2 :cdiv 2 :slen 100))
(def k2 (kicka :cbus cbus1 :cmod 4 :cdiv 4 :slen 100)))