 ;; -------------------------
 ;; Model
 (defonce state
-  (atom {:music ""
+  (atom {:music nil
+         :text ""
          :playing nil}))
 
 ;; -------------------------

  (swap! state assoc-in [:playing] nil))

(defn handle [expr-str]
  (swap! state assoc-in [:music] expr-str))

(defn toggle []
  (if (:playing @state)
    (kill)
    (beep)))

;; -------------------------
;; Views

      #(:value %)))

(defonce context (js/window.AudioContext.))
(defn beep [freq]
  (let [oscillator (.createOscillator context)]
    (doto oscillator
      (.connect (.-destination context))
      (-> .-frequency .-value (set! freq))
      (-> .-type (set! "square"))
      (.start 0))
    (swap! state assoc-in [:playing] oscillator)))
