techno, clojure style
Clojure
Latest commit 69ba1ce Feb 10, 2012 @hitch17 update blog link

README

# boots-n-cats - Techno, clojure style.
# See the blog at: http://eng.wealthfront.com/2012/02/boots-n-cats-every-techno-song-ever-in.html

$ lein new boots-and-cats
$ cd boots-and-cats

Then edit the <b>project.clj</b> file to contain:

(defproject boots-and-cats "1.0"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [overtone "0.6.0"]])

$ lein deps # Note: this downloads the entire internet.
$ lein repl
REPL started; server listening on localhost port 48182
user=> (use 'overtone.live)
[... prints a bunch of stuff talking about your audio system ...]
          _____                 __
         / __  /_  _____  _____/ /_____  ____  ___
        / / / / | / / _ \/ ___/ __/ __ \/ __ \/ _ \
       / /_/ /| |/ /  __/ /  / /_/ /_/ / / / /  __/
       \____/ |___/\___/_/   \__/\____/_/ /_/\___/


                          Programmable Music. v0.6
[...]
user=> (def boot (sample "boot.wav"))
#'user/boot
user=> (boot)
28
user=> (def cat (sample "cat.wav"))
#'user/cat
user=> (cat)
28
user=> (def boot-sample (load-sample "boot.wav"))
#'user/boot-sample
user=> (defsynth reverb-boot []
  (let [dry (play-buf 1 boot-sample)
        wet (free-verb dry 0.6)]
      (out 0 [wet dry])))
#<synth: reverb-boot>
user=> (reverb-boot)
28
user=> (def cat-sample (load-sample "cat.wav"))
#'user/cat-sample
user=> (defsynth reverb-cat []
  (let [dry (play-buf 1 cat-sample)
        wet (free-verb dry 0.6)]
    (out 0 [dry wet])))
#<synth: reverb-cat>
user=> (reverb-cat)
user=> (def bees (sample "bees.wav"))
#'user/bees
user=> (def kneehigh (sample "kneehigh.wav"))
#'user/kneehigh
user=> (def metro (metronome 60))
#'user/metro
user=> (defn player [beat]
  (at (metro beat) (reverb-boot))
  (at (metro (+ 0.5 beat)) (reverb-cat))
  (apply-at (metro (inc beat)) #'player (inc beat) []))
#'user/player
user=> (player (metro))
user=> (stop)