                         (take 68 (concat (map int bytes) (repeat 32)))
                         [247])]
     #_(midi/midi-sysex (:port-out controller) message)))
+
+(def touch-strip-mode-flags
+  "The values which are combined to set the touch strip into
+  particular modes."
+  {:touch-strip-controlled-by-push        0
+   :touch-strip-controlled-by-host        1
+   :touch-strip-host-sends-values         0
+   :touch-strip-host-sends-sysex          2
+   :touch-strip-values-sent-as-pitch-bend 0
+   :touch-strip-values-sent-as-mod-wheel  4
+   :touch-strip-leds-show-bar             0
+   :touch-strip-leds-show-point           8
+   :touch-strip-bar-starts-at-bottom      0
+   :touch-strip-bar-starts-at-center      16
+   :touch-strip-auto-return-inactive      0
+   :touch-strip-auto-return-active        32
+   :touch-strip-auto-return-to-bottom     0
+   :touch-strip-auto-return-to-center     64})
+
+(defn build-touch-strip-mode
+  "Calculate a touch strip mode byte based on a list of flags (keys in
+  `touch-strip-mode-flags`)."
+  [& flags]
+  (apply + (map touch-strip-mode-flags (set flags))))
+
+(def touch-strip-mode-default
+  "The mode to which we should return the touch strip when we are
+  shutting down."
+  (build-touch-strip-mode :touch-strip-controlled-by-push :touch-strip-host-sends-values
+                          :touch-strip-values-sent-as-pitch-bend :touch-strip-leds-show-point
+                          :touch-strip-bar-starts-at-bottom :touch-strip-auto-return-active
+                          :touch-strip-auto-return-to-center))
+
+(def touch-strip-mode-level
+  "The mode to which we should set the touch strip when the user is
+  editing a pan-style control."
+  (build-touch-strip-mode :touch-strip-controlled-by-host :touch-strip-host-sends-values
+                          :touch-strip-values-sent-as-pitch-bend :touch-strip-leds-show-bar
+                          :touch-strip-bar-starts-at-bottom :touch-strip-auto-return-inactive
+                          :touch-strip-auto-return-to-center))
+
+(def touch-strip-mode-pan
+  "The mode to which we should set the touch strip when the user is
+  editing a level-style control."
+  (build-touch-strip-mode :touch-strip-controlled-by-host :touch-strip-host-sends-values
+                          :touch-strip-values-sent-as-pitch-bend :touch-strip-leds-show-bar
+                          :touch-strip-bar-starts-at-center :touch-strip-auto-return-inactive
+                          :touch-strip-auto-return-to-center))
+
+(def touch-strip-mode-hue
+  "The mode to which we should set the touch strip when the user is
+  editing a hue."
+  (build-touch-strip-mode :touch-strip-controlled-by-host :touch-strip-host-sends-values
+                          :touch-strip-values-sent-as-pitch-bend :touch-strip-leds-show-point
+                          :touch-strip-bar-starts-at-bottom :touch-strip-auto-return-inactive
+                          :touch-strip-auto-return-to-center))
 
 (defn- clear-display-buffer
   "Clear the graphical display buffer in preparation for drawing an

  [controller x color]
  (set-button-color controller (get control-buttons (keyword (str "encoder-pad-" x))) color))

(defn set-display-line
  "Sets a line of the text display."
  [controller line bytes]
  {:pre [(<= 0 line 3)]}

  (doseq [[_ button] control-buttons]
    (set-button-color controller button off-color))
  (reset! (:last-text-buttons controller) {})
  (set-touch-strip-mode controller touch-strip-mode-default)
  (reset! (:last-touch-strip controller) nil))

(defn- calculate-touch-strip-value
