   overlay."
   [controller message]
   (let [note (:note message)]
-    (when (and (<= 1 (rem note 10) 8) (<= 1 (quot note 10) 8))
-      (cue-grid-pressed controller note))))
+    (if (and (<= 1 (rem note 10) 8) (<= 1 (quot note 10) 8))
+      (cue-grid-pressed controller note)
+      (case note
+        89  ; Volume (tap tempo) button
+        (when (pos? (:velocity message))
+          ((:tempo-tap-handler controller)))
+
+        79  ; Pan (shift) button
+        (reset! (:shift-mode controller) (pos? (:velocity message)))
+
+        49  ; Stop button
+        (when (pos? (:velocity message))
+          (enter-stop-mode controller))
+
+        ;; Something we don't care about
+        nil))))
 
 (defn- note-off-received
   "Process a note-off message which was not handled by an interface
   overlay."
   [controller message]
   (case (:note message)
+
+    79  ; Pan (shift) button
+    (reset! (:shift-mode controller) false)
 
     ;; Something we don't care about
     nil))

                              (when task (at-at/kill task))
                              nil))
  (clear-interface controller)
  ;; In case Live isn't running, leave the User Mode button dimly lit, to help the user return.
  (set-led-color controller (:user-mode control-buttons) button-available-color)
  (controllers/add-overlay (:overlays controller)
                           (reify controllers/IOverlay
                             (captured-controls [this] #{(:user-mode control-buttons)})
                             (captured-notes [this] #{})
                             (adjust-interface [this _]
                               true)

            [taoensso.truss :as truss :refer [have have! have?]]))

(def control-buttons
  "The round buttons along the top which send and respond to Control
  Change events."
  {:up-arrow    104
   :down-arrow  105
   :left-arrow  106
   :right-arrow 107
   :session     108
   :user-1      109
   :user-2      110
   :mixer       111})

(def note-buttons
  "The round buttons along the right which send and respond to Note
  events."
  {:volume     89  ; Used as tap tempo
   :pan        79  ; Used as shift
   :send-a     69
   :send-b     59
   :stop       49
   :mute       39
   :solo       29
   :record-arm 19})

(def button-off-color
  "The color of buttons that are completely off."
