                  [:button {:on-click #(handle! (action/->Stop))} "Stop"])
         error (:error state)]
     [:div
-     [:div {:class "graph"} [graph handle! state]]
+     [:div {:class "graph"} [graph handle! state-atom]]
      [:div {:class "controls"} button]
      [:div {:class (if error "error" "")} [editor handle! state]]]))

               :middleware [middleware/fun-mode]
               :size [600 300]))

(defn graph [handle! state]
  (reagent/create-class
    {:render (fn [] [:canvas#graph {:width 300 :height 300}])
     :component-did-update #(draw-graph state)}))

(defn editor-did-mount [handle! _]
  (fn [this]

    [quil.middleware :as middleware]
    [reagent.core :as reagent]))

(defn draw-graph [state-atom]
  (quil/sketch :setup (constantly nil)
               :draw (fn [_]
                       (quil/background 255)
                       (doseq [{:keys [time pitch]} (:music @state-atom)]
                         (quil/ellipse
                           (-> time (* 100) (+ 17))
                           (-> pitch - (* 0.25) (+ 300))
