   [{w :w h :h playhead :playhead :as instrument}]
   {:x 0 :y (t->px instrument playhead) :w w :h h})
 
+(defn finger-pushing?
+  [instrument]
+  (not (nil? (-> instrument :scroll :touch-id))))
+
+(defn scrolling?
+  [instrument]
+  (or (finger-pushing? instrument)
+      (not= (-> instrument :scroll :speed) 0)))
+
 (defn draw-note
   [draw-ctx instrument note]
   (let [{x :x y :y w :w h :h} (note-rect note instrument)]
-    (set! (.-fillStyle draw-ctx) "white")
+    (set! (.-fillStyle draw-ctx) "#FFFFFF")
     (.fillRect draw-ctx x y w h)))
 
 (defn colliding?

  (.sqrt js/Math (+ (.pow js/Math (- x2 x1) 2) (.pow js/Math (- y2 y1) 2))))

(defn finger-push
  [{touch-id :touch-id touch-y-distance :y-distance} instrument]
  (-> instrument
      (assoc-in [:scroll :distance] touch-y-distance)
      (assoc-in [:scroll :touch-id] touch-id)))

(defn stop-finger-push
  [{touch-y-distance :y-distance} instrument]
  (-> instrument
      (assoc-in [:scroll :distance] 0)
      (assoc-in [:scroll :touch-id] nil)))

(defn stop-scroll
  [touch instrument]
  (assoc-in instrument [:scroll :speed] 0))

(defn scroll
  [{{distance :distance speed :speed friction :friction} :scroll
    playhead :playhead :as instrument}
   delta]
  (let [pre-zeno-speed (* (+ speed distance)
                          (if (finger-pushing? instrument) 1 friction))
        speed (if (< (.abs js/Math pre-zeno-speed) 1) 0 pre-zeno-speed)]
    (-> instrument
        (assoc :playhead (+ playhead speed))
        (assoc-in [:scroll :speed] speed))))

(defn fire-touch-hold-on-instrument
  [touch instrument]

  [instrument delta]
  (-> instrument
      (step-time delta)
      (inertial-scroll delta)))

(prevent-scrolling)
(set-up-web-audio-on-first-touch)
