     
     ;; Flash the tap tempo button on beats
     (let [metronome (:metronome (:show controller))
-          marker (rhythm/metro-marker metronome)]
+          marker (rhythm/metro-marker metronome)
+          colors (metronome-sync-colors controller)]
       (swap! (:next-text-buttons controller)
              assoc (:tap-tempo control-buttons)
              (if (or (new-beat? controller marker) (< (rhythm/metro-beat-phase metronome) 0.15))
-               button-active-color button-available-color)))
+               (second colors) (first colors))))
 
     ;; Make the User button bright, since we live in User mode
     (swap! (:next-text-buttons controller)

(defn- interpret-tempo-tap
  "React appropriately to a tempo tap, based on the sync mode of the
  show metronome. If it is manual, invoke the metronome tap-tempo
  handler. If MIDI, align the current beat to the tap. If DJ Link, set
  the current beat to be a down beat (first beat of a bar)."
  [controller]
  (with-show (:show controller)
    (let [metronome (get-in controller [:show :metronome])]
      (case (:level (show/sync-status))
        nil ((:tap-tempo-handler controller))
        :bpm (rhythm/metro-beat-phase metronome 0)
        :beat (rhythm/metro-bar-start metronome (rhythm/metro-bar metronome))
        :bar (rhythm/metro-phrase-start metronome (rhythm/metro-bar metronome))
        (warn "Don't know how to tap tempo for sync type" (show/sync-status))))))

(defn- leave-user-mode
  "The user has asked to exit user mode, so suspend our display

  (when (not= marker @(:last-marker controller))
    (reset! (:last-marker controller) marker)))

(defn- metronome-sync-colors
  "Determine the colors to light the tap tempo button. Returns a tuple
  of the off-beat and on-beat colors based on the current sync
  status."
  [controller]
  (with-show (:show controller)
    (if (= (:type (show/sync-status)) :manual)
      [click-unsynced-off-beat-color click-unsynced-beat-color]
      (if (:current (show/sync-status))
        [click-synced-off-beat-color click-synced-beat-color]
        [stop-available-color stop-active-color]))))

(defn- update-interface
  "Determine the desired current state of the interface, and send any
  changes needed to get it to that state."
