     (* tonic-freq (Math/pow 2 octave) (nth (get @tuning-map @tuning) interval))))
 
 (if (not (o/server-connected?))
-  (o/boot-external-server))
-  ;(o/connect-external-server 60106))
+  ;(o/boot-external-server 57110)
+  (o/connect-external-server 57110)
+)
 
 (require '[overtone.inst.synth :as syn])
 

        oldmap (get @melody-map id)
        newmap (assoc oldmap :instr val)]
    (swap! melody-map assoc id newmap)))    
  
(defn tonic-chooser [e]
  (let [val (value (.getSource e))]
    (case val
      "A"       (reset! tonic :a3)
      "B\u266D" (reset! tonic :a#3)
      "B"       (reset! tonic :b3)
      "C"       (reset! tonic :c4)
      "C\u266F" (reset! tonic :c#4)
      "D"       (reset! tonic :d4)
      "E\u266D" (reset! tonic :d#4)
      "E"       (reset! tonic :e4)
      "F"       (reset! tonic :f4)
      "F\u266F" (reset! tonic :f#4)
      "G"       (reset! tonic :g4)
      "G\u266F" (reset! tonic :g#4))))

(defn str->midi [strnote]
  (let [oct (read-string (str (last strnote)))
        len (dec (count strnote))
        val (subs strnote 0 len)
        octch (* 12 (- oct 4))]
    (case val
      "C"       (+ 60 octch)
      "C\u266F" (+ 61 octch)
      "D"       (+ 62 octch)
      "E\u266D" (+ 63 octch)
      "E"       (+ 64 octch)
      "F"       (+ 65 octch)
      "F\u266F" (+ 66 octch)
      "G"       (+ 67 octch)
      "G\u266F" (+ 68 octch)
      "A"       (+ 69 octch)
      "B\u266D" (+ 70 octch)
      "B"       (+ 71 octch)
)))

(defn tuning-chooser [e]
  (let [val (value (.getSource e))]
    (case val

    (swap! melody-map assoc id {:pitches numcbs, :beats numcbs,
                                :root f, :instr "Default"})
    (add-note-circles id pan)
    (let [rowops (make-rowops-panel id)
          mel-controls (make-transform-panel id :pitches)
          rhy-controls (make-transform-panel id :beats)
          verticalpanel (vertical-panel :items [rowops mel-controls pan
                                                rhy-controls chinstr
                                                playsolo controls])]
      (config! f :content verticalpanel)
      (-> f pack! show!)
      f)))
