         partrepeats (map #(/ totaltime %) times)
         score (atom '())]
     (doseq [i (range len)]
-      (let [rhythm (apply concat (repeat (nth partrepeats i) (second (nth parts i))))
-            melodyseq (apply concat (repeat (nth partrepeats i) (first (nth parts i))))
+      (let [thispart (nth parts i)
+            thisinstr (nth thispart 3)
+            thisrepeats (nth partrepeats i)
+            rhythm (apply concat (repeat thisrepeats (second thispart)))
+            melodyseq (apply concat (repeat thisrepeats (first thispart)))
             notes (map str->midi melodyseq)
-            part (map vector notes rhythm)]
+            part (cons thisinstr (map vector notes rhythm))]
         (swap! score conj part)))
     @score))
 

(defn play-melody [e]
  (let [score (or @melody
                  (make-score))]
    (doseq [part score]
      (play one-twenty-bpm inst-cur part {:midi true}))))

(defn play-solo [id e]
  (let [[mel rhy] (make-part id)
        notes (map str->midi mel)
        part (map vector notes rhy)]
    (play one-twenty-bpm inst-cur part {:midi true})))  
    
(defn remove-circle [id kw]
  (let [len (get-in @melody-map [id kw])

                                     :id :tuningChooser
                                     :listen [:action tuning-chooser])
                           (label "Melody:")
                           (combobox :model ["Major Scale" "Minor Scale"
                                             "Art of Fugue" "Patterns"]
                                     :id :melodyChooser
                                     :listen [:action melody-chooser])
                           ])))
