         rhyvals (remove-circle id :beats)
         len (get-in @melody-map [id :beats])
         idprefix (s/join ["#kb-" id "-rhy-"])
-        kwlist (vec (map #(keyword (s/join [idprefix (str %)])) (range len)))]
+        kwlist (vec (map #(keyword (s/join [idprefix (str %)])) (range len)))
+        transtag (keyword (s/join ["#kb-" id "-mel-translate"]))
+        transbut (select root [transtag])]
     (remove-circle id :pitches)
     (swap! melody-map assoc-in [id :pitches] newnum)
     (config! panel :items (concat (make-note-circle-mel id) (make-note-circle-rhy id)))
     (doseq [kw kwlist]
       (value! (select panel [kw]) (get rhyvals kw)))
-    ))
+    (config! transbut :model (range newnum))))
         
 (defn change-circle-rhy [id newnum]
   (let [root (get-in @melody-map [id :root])

        melvals (remove-circle id :pitches)
        len (get-in @melody-map [id :pitches])
        idprefix (s/join ["#kb-" id "-mel-"])
        kwlist (vec (map #(keyword (s/join [idprefix (str %)])) (range len)))]
    (remove-circle id :beats)
    (swap! melody-map assoc-in [id :beats] newnum)
    (config! panel :items (concat (make-note-circle-mel id) (make-note-circle-rhy id)))
    (doseq [kw kwlist]
      (value! (select panel [kw]) (get melvals kw)))
    ))
        
(defn make-panel-controls [id]
  (let [cbp (combobox :model (range 1 10)
                      :id (keyword (s/join ["kb-" (str id) "-numpitch"]))


(if (not (o/server-connected?))
  (o/boot-external-server))
  ;(o/connect-external-server 60106))

(require '[overtone.inst.synth :as syn])

