 (ns examples.satie
-  (:use [overtone.live])
+  (:use [clojure.core.match :only [match]]
+        [overtone.live]
+        [overtone.inst sampled-piano])
   (:require [polynome.core :as poly]))
 
 ;;Erik Satie Gnossienne No. 1
-
-;;Piano samples downloaded from: http://blackhole12.newgrounds.com/news/post/92464
-(defonce piano-samples (load-samples "~/Desktop/samples/MIS_Stereo_Piano/Piano/*LOUD*"))
-
-
-(defn matching-notes
-  [note]
-  (filter #(if-let [n (match-note (:name %))]
-             (= note (:midi-note n)))
-          piano-samples))
-
-(defn sampled-piano
-  ([note] (sampled-piano note 1))
-  ([note vol]
-     (if-let [sample (first (matching-notes note))]
-       (stereo-player sample :vol (* 0.01 vol)))))
-
 (def phrase1a [:iii :v :iv# :iii :iii :ii# :iii :ii#])
 (def phrase1b [:iii :v :iv# :iii :v# :vi :v# :vi])
 (def phrase1c [:iii :v :iv# :iii :iii :ii# :i :vii- :vi- :vii- :vi- :vii- :i :vii- :vii- :vi-])

                                phrase3
                                phrase2
                                phrase2
                                 phrase1a-reprise
                                phrase1b-reprise
                                phrase1a-reprise
                                phrase1b-reprise

                               phrase1-bass                            ;;U
                               ))

(def lh-pitches (degrees->pitches left-hand-degrees :major :Ab4))
(def rh-pitches (degrees->pitches right-hand-degrees :major :Ab4))

(def cur-pitch-rh (atom -1))
(def cur-pitch-lh (atom -1))
