            :on-change (fn [e]
                         (swap! app-state assoc param (.-target.value e)))}])
 
+(defn selector [param value options]
+  [:select {:value value
+            :on-change (fn [e]
+                         (swap! app-state assoc param (keyword (.-target.value e))))}
+   (map (fn [v] [:option {:key v :value v} (str v)]) options)])
+
+
 (defn playback-toggle []
   (let [playing (:playing @app-state)]
     [:button {:on-click (fn [e]

   (synth/percussive 0.01 0.4)
   (synth/gain 0.1)))

(defonce initial-automaton
  [[0.25 0.125 0.5 0.25 0.125 0.5 0.5]
   [1 2 0 4 5 6 3]])

           :playing false
           :automaton initial-automaton
           :seed initial-seed
           :music (automate-music initial-automaton initial-seed)}))

(defn play-next! [notes]
  (let [{:keys [context playing tempo scale]} @app-state
        {:keys [pitch duration] :as note} (first notes)
        duration ((bpm tempo) duration)
        remainder (rest notes)
        at (synth/current-time context)
        synth-instance (-> note
                           (update :pitch (comp temperament/equal (get scales scale)))
                           (dissoc :time)
                           ping)
        connected-instance (synth/connect synth-instance synth/destination)]
