            :playing false
            :automaton initial-automaton
            :seed initial-seed
-           :music (->>
-                   (automate-music initial-automaton initial-seed)
-                   (tempo (bpm initial-tempo))
-                   (where :pitch initial-scale))}))
+           :music (automate-music initial-automaton initial-seed)}))
 
 (defn play-next! [notes]
-  (let [{:keys [context playing]} @app-state
-        {:keys [time duration] :as note} (first 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 temperament/equal)
+                           (update :pitch (comp temperament/equal (get scales scale)))
                            (dissoc :time)
                            ping)
         connected-instance (synth/connect synth-instance synth/destination)]

           :on-change (fn [e]
                        (swap! app-state assoc param (.-target.value e)))}])

(defn playback-toggle []
  (let [playing (:playing @app-state)]
    [:button {:on-click (fn [e]

  50)

(defonce initial-scale
  :c-major)

(defonce app-state
  (r/atom {:context (synth/audio-context)
