    (where :part (is :thePart))))
 
 
+
+
 (defn doit [] 
   (->>
    melody
    (with beats1)
    (with beats2)
+   (with chords)
    (where :time (bpm 120))
    (where :duration (bpm 120))
-   (where :pitch (comp A flat minor))
+   (where :pitch (comp high A  minor))
    play))

   (where :time  (from delayBeforeStart))
   (where :part (is :theBeats2))))


(def melody
  (->>

   (phrase [  4/8  5/8   4/8  6/8  6/8  9/8  9/8  6/8   8/8  6/8 ]
           [  0    0     2    1    0    0    1    0     -1   -4  ])


            [overtone.synth.stringed :as strings]))

(defmethod play-note :thePart [{midi :pitch}] (snth/overpad midi :amp 0.2))
(defmethod play-note :theBeats1 [{midi :pitch}] (drum/kick midi))
(defmethod play-note :theBeats2 [{midi :pitch}] (drum/hat3 midi :amp 0.02))

(def g (strings/guitar))

(def updownmap {
                81 :up
                83 :down
                84 :up
                86 :down
                88 :up
                89 :down
                })
(def amgmap {
                81 :Am
                83 :Am
                84 :G
                86 :G
                88 :E
                89 :E7
                })

(defmethod play-note :theStrumming [{midi :pitch}] (strings/guitar-strum g (amgmap midi) (updownmap midi) 0.101) (println midi))

(def beatCount 20)
(def delayBeforeStart 1/4)

(def beats1
  (->>
   (phrase (take (- beatCount 2) (cycle [12/8]))
           (take (- beatCount 2) (cycle [0])))
   (where :time  (from delayBeforeStart))
   (where :part (is :theBeats1))))

