       (let [val {:panhash (dissoc v :root),
                  :circhash (make-circles-hash k)}]
         (swap! dump assoc k val)))
+    (swap! dump assoc :tempo @tempo)
     @dump))
         
+;; create slider used to adjust tempo
+(def tempo-slider
+  (slider :orientation :horizontal
+          ;:value 120
+          :min 20
+          :max 360
+          :snap-to-ticks? false
+          :paint-labels? true
+          :major-tick-spacing 100
+          :minor-tick-spacing 20))
+
 (defn restore-dump [dump]
-  (doseq [[oldid {:keys [panhash circhash]}] dump]
+  (value! tempo-slider (get dump :tempo))
+  (doseq [[oldid {:keys [panhash circhash]}] (dissoc dump :tempo)]
     (restore-panel oldid panhash circhash)))
 
 (defn save-pattern [e]


(defn play
  ([metronome inst score {midiq :midi}]
     (play metronome (metronome) inst score {:midi midiq}))
  ([metronome beat instrument score {midiq :midi}]
     (let [cur-note (first score)]
       (when cur-note
         (let [next-beat (play-one metronome beat instrument cur-note {:midi midiq})]
           (o/apply-at (metronome next-beat) play metronome next-beat instrument
             (next score) {:midi midiq} []))))))

(def a-scale ["A" "B\u266D" "B" "C" "C\u266F" "D"
              "E\u266D" "E" "F" "F\u266F" "G" "G\u266F"] )

            notes (map str->midi melodyseq)
            part (cons thisinstr (map vector notes rhythm))]
        (swap! score conj part)))
    [@score, totaltime]))

(defn play-melody [e]
  (let [[score len] (if @melody
                      [@melody 20]
                      (make-score))
        metro (o/metronome @tempo)
        endseq (atom '())]
    (doseq [[instr & part] score]
      (play metro (str->instr instr) part {:midi true}))
    (o/apply-at (metro len) #(if @repetition (play-melody nil)))
    ))
  
(defn play-solo [id e]
  (let [[mel rhy _ instr] (make-part id)
        notes (map str->midi mel)
        part (map vector notes rhy)]
    (play (o/metronome @tempo) (str->instr instr) part {:midi true})))  
    
(defn remove-circle [id kw]
  (let [len (get-in @melody-map [id kw])
