Skip to content

Instantly share code, notes, and snippets.

@devn
Created May 28, 2012 16:28
Show Gist options
  • Select an option

  • Save devn/2819981 to your computer and use it in GitHub Desktop.

Select an option

Save devn/2819981 to your computer and use it in GitHub Desktop.
Dan Reeder - Two Songs That I know
(ns two-songs.core
(:use [overtone.live]
[overtone.inst.sampled-piano])
(:require [overtone.music.pitch :as pitch]))
(def metro (metronome 120))
(def chord-seq [(pitch/chord :e4 :major)
(pitch/chord :c#4 :minor7)
(pitch/chord :f#4 :minor7)
(pitch/chord :b4 :major)])
(def bass-line [40 49 42 47])
(def song (interleave bass-line chord-seq))
(defn play-song [t dur notes]
(if (seq? (first notes))
(at t (doseq [note (first notes)]
(sampled-piano note)))
(at t (sampled-piano (first notes))))
(apply-at (+ t dur) #'play-song (+ t dur) dur (next notes) []))
;; (play-song (now) 1200 (cycle song))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment