                            ;; spacer
                            (label :text ""
                                   :size [100 :by 30])
+                           (label "Tempo:")
+                           tempo-slider
+                           ;; spacer
+                           (label :text ""
+                                  :size [100 :by 30])
+                           (horizontal-panel
+                            :items [(button :id :repeats
+                                            :text "Repeat?"
+                                            :listen [:action repeat-action])
+                                    repeat-label])
+                           (combobox :model instruments
+                                     :id :instChooser
+                                     :listen [:action inst-chooser])
                            (label "Instrument:")
                            (combobox :model instruments
                                      :id :instChooser


(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])
