Skip to content

Instantly share code, notes, and snippets.

@rohitvvv
Created January 19, 2018 18:25
Show Gist options
  • Save rohitvvv/bf984178a922e65cfe5d450d63d40ffe to your computer and use it in GitHub Desktop.
Save rohitvvv/bf984178a922e65cfe5d450d63d40ffe to your computer and use it in GitHub Desktop.
Scary Fibonacci
(ns overtone.core)
(use 'overtone.live)
(use 'overtone.inst.piano)
(defn fibn
"Find nth fibonacii number"
[n]
(loop [index 0 x 1 y 1]
(if (= index n)
y
(recur (inc index) y (+ x y)))))
(defn playsomething
[x]
(Thread/sleep 200)
(piano (mod x 130)))
(map playsomething (map fibn (range 0 500)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment