Last active
May 8, 2019 06:01
-
-
Save illiichi/9547c0fa9cf1aa77013ca1fd3589b78f to your computer and use it in GitHub Desktop.
10 minutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; this didn't work for me. use lein instead | |
> clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.8.0"} overtone {:mvn/version "0.10.3"}}}' -r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject ten_minutes "0.1.0-SNAPSHOT" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:jvm-opts ["-Xmx2g" "-server"] | |
:dependencies [[org.clojure/clojure "1.8.0"] | |
[overtone "0.10.3"]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'overtone.live) | |
(def track-length (* 10 60)) | |
(def fade-out-length 15) | |
(defmacro play-track [body] | |
`(demo ~track-length | |
(let [~'base (lf-saw:kr (x-line:kr 0.0002 8 ~track-length)) | |
~'room (lin-lin ~'base -1 1 0.2 1) | |
~'freq (demand:kr ~'base 0 (drand (->> (iterate #(* % 1.5) 600) | |
(take 6)) | |
INF)) | |
~'gate (impulse (lin-lin (sin-osc:kr (/ 1 60) (* 1/2 Math/PI)) | |
-1 1 0.5 2.2)) | |
~'f-env (env-gen (envelope [0 3 1] [0.0 0.001]) [(dust:kr 1) (dust:kr 1)])] | |
(hold ~body | |
~(- track-length fade-out-length) | |
~fade-out-length | |
FREE)))) | |
(defmacro reduce-> | |
[initial f xs] | |
`(reduce ~f ~initial ~xs)) | |
;; 00:00:00-00:10:00 | |
(play-track | |
(-> (* (saw (* [0.999 1.001] freq)) | |
(env-gen (env-perc 0.5 0.05) gate)) | |
(reduce-> #(free-verb %1 (lin-lin (lf-saw:kr %2) -1 1 0 1) room) | |
[0.08 0.1 1/3]) | |
tanh)) | |
;; 00:10:00-00:20:00 | |
(play-track | |
(-> (* (sin-osc (* f-env (lin-lin (mix (map lf-pulse [(* room 1/2) 3 8])) 0 1 1 3/2) | |
freq)) | |
(env-gen (env-perc 0.05 2) gate)) | |
(reduce-> #(free-verb %1 %2 room 0.5) [0.4 0.1 0.3 0.2]))) | |
;; 00:20:00-00:30:00 | |
(play-track | |
(-> (* (white-noise) | |
(env-gen (env-perc 0.05 2) gate)) | |
(reduce-> #(sin-osc (* %1 %2)) (->> (iterate #(* % 1.1) 500) | |
(take 8))) | |
(ringz (* f-env freq) room) | |
tanh)) | |
;; 00:30:00-00:40:00 | |
(play-track | |
(let [i (stepper gate 0 1 8 1)] | |
(-> (* (sin-osc freq) | |
(env-gen (env-perc 0.05 2) gate)) | |
(reduce-> #(ringz %1 %2 0.01) [10 3]) | |
(* (lf-pulse 1/2 room 1/8)) | |
(ringz (* f-env i 1/4 freq) room) | |
(free-verb 0.33 room) | |
tanh))) | |
;; 00:40:00-00:50:00 | |
(play-track | |
(-> (* (sin-osc (* f-env (lin-lin (mix (map lf-pulse [1/7 3 8])) 0 1 1 3/2) | |
freq)) | |
(env-gen (env-perc 0.2 0.01) gate)) | |
(reduce-> #(ringz % (* f-env %2 freq) room) (->> (iterate #(* % 1.25) 1/8) | |
(take 16))) | |
tanh)) | |
;; 00:50:00-01:00:00 | |
(play-track | |
(-> (* (white-noise) | |
(env-gen (env-perc 0 0.01) gate)) | |
(ringz (* f-env freq) room) | |
(free-verb (lin-lin (lf-saw 0.08 [0 1]) 0.1 0.8) room) | |
tanh)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment