                      nil)
                    (when (not @paused?)
                      (case (key-name e)
-                       :down  (put! down-chan true)
                        :left  (try-move! -1 0)
                        :right (try-move!  1 0)
+                       :down  (put! move-down-chan true)
                        :space (hard-drop!)
                        :up    (try-rotate!)
                        nil))

  (size-canvas! "mainGameCanvas" empty-board cell-size rows-cutoff)
  (size-canvas! "nextPieceCanvas" (next-piece-board) cell-size)

  (try-spawn-piece!)
  (add-key-events)
  (go-go-draw!)

(def music-playing?
  "Boolean flag signaling if the music is playing or not"
  (atom false))

;;------------------------------------------------------------------------------
;; Piece Control Throttling
;;------------------------------------------------------------------------------

; These channels can received boolean signals indicating on/off status.
; Duplicate signals are ignored with the (dedupe) transducer.
(def move-down-chan (chan 1 (dedupe)))

(defn go-go-control-soft-drop!
  "Monitor move-down-chan to update the gravity speed."
  []
  (go-loop []
    (let [[value c] (alts! [quit-chan move-down-chan])]
      (when (= c move-down-chan)
        (swap! state assoc :soft-drop value)
        (refresh-gravity!)
        (recur)))))

;;------------------------------------------------------------------------------
;; State Monitor
