Skip to content

Commit 4ccc62b

Browse files
committed
make thx sound more beefy
1 parent b8d6818 commit 4ccc62b

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

examples/thx.clj

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(ns examples.thx
22
(use [overtone.live]))
33

4-
;;THX sound simulation by Geirmund Simonsen
4+
;;Original THX sound simulation by Geirmund Simonsen:
55
;;{
66
;; var randomFreq, ampEnv, riseCurve, doAdder, doArray;
77
;; doAdder = 0;
@@ -13,12 +13,21 @@
1313
;; Out.ar(0, doAdder*ampEnv);
1414
;;}.play
1515

16+
(definst thx [gate 1]
17+
(let [target-pitches (map midi->hz [77 74 72 70 65 62 60 58 53 50 46 34 26 22 14 10 ])
18+
r-freq (env-gen:kr (envelope [1 1 0.007 10] [8 4 2] [0 -4 1] 2) gate )
19+
amp-env (env-gen:kr (envelope [0 0.07 0.21 0] [8 4 2] [0 1 1] 2) gate :action FREE)
20+
mk-noise (fn [ug-osc]
21+
(mix (map #(pan2 (ug-osc (+ (* r-freq (+ 230 (* 100 (lf-noise2:kr 1.3))))
22+
(env-gen:kr (envelope [0 0 %] [8 6] [0 -3]))))
23+
(lf-noise2:kr 5))
24+
target-pitches)))
25+
saws (mk-noise saw)
26+
sins (mk-noise sin-osc)
27+
snd (+ (* saws amp-env) (* sins amp-env))]
28+
(g-verb snd 9 0.7 0)))
1629

17-
(demo 25
18-
(let [target-pitches (map midi->hz [77 74 72 70 65 62 60 58 53 50 46 34])
19-
r-freq (env-gen:kr (envelope [1 1 0.007] [8 6] [0 -4]) 1)
20-
amp-env (env-gen:kr (envelope [0.07 0.07 0.21] [8 6] [0 1]) 1)
21-
saws (apply + (map #(pan2 (saw (+ (* r-freq (+ 230 (* 100 (lf-noise2:kr 1.3))))
22-
(env-gen:kr (envelope [0 0 %] [8 6] [0 -3]) 1)))
23-
(lf-noise2:kr 1.3)) target-pitches))]
24-
(* saws amp-env)))
30+
;;play the instrument:
31+
;;(thx)
32+
;;kill it off when you're ready
33+
;;(ctl thx :gate 0)

0 commit comments

Comments
 (0)