     ;; TODO: Loop over the most recent four active cues, rendering information
     ;;       about them.
 
-    (let [metronome (:metronome (:show controller))
-          metronome-button (:metronome control-buttons)
-          tap-tempo-button (:tap-tempo control-buttons)
-          metronome-mode @(:metronome-mode controller)]
-      ;; Should the first cell display metronome information?
-      (if (seq metronome-mode)
-        (let [metronome (:metronome (:show controller))
-              marker (rhythm/metro-marker metronome)
-              bpm (format "%.1f" (float (rhythm/metro-bpm metronome)))
-              chars (+ (count marker) (count bpm))
-              padding (apply str (take (- 17 chars) (repeat " ")))]
-          (swap! (:next-text-buttons controller)
-                 assoc metronome-button (button-state metronome-button :bright))
-          (write-display-cell controller 3 0 (str marker padding bpm))
-          (write-display-cell controller 2 0 "Beat        BPM  ")
-          (when (:adjusting-beat metronome-mode)
-            (aset (get (:next-display controller) 2) (dec (count marker)) (byte 1)))
-          (when (:adjusting-bpm metronome-mode)
-            (aset (get (:next-display controller) 2) 16 (byte 1))))
-        (swap! (:next-text-buttons controller)
-               assoc metronome-button (button-state metronome-button :dim)))
-      ;; Regardless, flash the tap tempo button on beats
-      (swap! (:next-text-buttons controller)
-             assoc tap-tempo-button
-             (button-state tap-tempo-button
-                           (if (< (rhythm/metro-beat-phase metronome) 0.15)
-                             :bright :dim))))
+    (update-metronome-section controller)
+
+    ;; Reflect the shift button state
+    (swap! (:next-text-buttons controller)
+           assoc (:shift control-buttons)
+           (button-state (:shift control-buttons)
+                         (if @(:shift-mode controller) :bright :dim)))
     
     (update-text controller)
     (update-text-buttons controller)

   :quantize {:control 116 :kind :monochrome}
   :double   {:control 117 :kind :monochrome}
   :delete   {:control 118 :kind :monochrome}
   :undo     {:control 119 :kind :monochrome}
   
   })

(defn button-state
  "Calculate the numeric value that corresponds to a particular

    14 ; Beat encoder
    (let [delta (sign-velocity (:velocity message))
          snapshot (rhythm/metro-snapshot (:metronome (:show controller)))]
      (if @(:shift-mode controller)
        ;; User is adjusting the current bar
        (rhythm/metro-bar-start (:metronome (:show controller)) (+ (:bar snapshot) delta))
        ;; User is adjusting the current beat; keep the phase unchanged
        (do
          (rhythm/metro-start (:metronome (:show controller)) (+ (:beat snapshot) delta))
          (rhythm/metro-beat-phase (:metronome (:show controller) (:beat-phase snapshot))))))
    
    15 ; BPM encoder
    (let [delta (/ (sign-velocity (:velocity message)) 10)
          bpm (rhythm/metro-bpm (:metronome (:show controller)))]
      (rhythm/metro-bpm (:metronome (:show controller)) (+ bpm delta)))

    49 ; Shift button
    (swap! (:shift-mode controller) (fn [_] (> (:velocity message) 0)))

    ;; Something we don't care about
    nil))
