         scaled-init (* (/ (- init-val min-val)
                           (double (- max-val min-val)))
                        SLIDER-MAX)
-        slider (slider :value scaled-init :min 0 :max SLIDER-MAX :orientation :horizontal)
+        slider (slider :id (keyword name) :class :synth-control-slider
+                       :value scaled-init :min 0 :max SLIDER-MAX :orientation :horizontal)
         label  (label name)
         items  [[label "width 80:80:100"]
                 [spinner "width 80:80:80"]

(ns overtone.gui.control
  (:use [seesaw core mig])
  (:require [seesaw.bind :as bind]))

(native!)

  (reset-synth-defaults foo)
  "
  [synth]
  (invoke-now
    (let [full-params (filter #(not (or (= :none (:type %))
                                        (nil? (:min %))
                                        (nil? (:max %))
                                        (nil? (:step %))))
                              (:params synth))]
      (if (zero? (count full-params))
        (alert (str "The " (:name synth) " synth or instrument does not have any parameters
with the required meta-data.  (e.g.  [freq {:default 80 :min 40 :max 880 :step 1}])"))
        (let [control-panes (mapcat
                              (fn [{:keys [name default min max step value]}]
                                (control-slider name default min max step value))
                              full-params)
              pane (mig-panel :constraints ["" "[right][center][center]" ""]
                              :items control-panes)
              frame (frame :title (:name synth)
                           :content pane
                           :on-close :dispose)]
          (-> frame pack! show!))))))

