 
 
     ;; Dimmer cues to turn on and set brightness of groups of lights
-    (ct/set-cue! (:cue-grid *show*) 0 2
-                 (cues/cue :dimmers (fn [var-map] (global-dimmer-effect
-                                                   (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                   :effect-name "All Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers
-                                                     :puck-dimmers :hex-dimmers :snowball-dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 1 2
-                 (cues/cue :torrent-dimmers (fn [var-map] (dimmer-effect
-                                                           (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                           (show/fixtures-named "torrent")
-                                                           :effect-name "Torrent Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 2 2
-                 (cues/cue :blade-dimmers (fn [var-map] (dimmer-effect
-                                                         (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                         (show/fixtures-named "blade")
-                                                         :effect-name "Blade Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 3 2
-                 (cues/cue :ws-dimmers (fn [var-map] (dimmer-effect
-                                                      (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                      (show/fixtures-named "ws")
-                                                      :effect-name "Weather System Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:dimmers]))
-
-    (ct/set-cue! (:cue-grid *show*) 4 2
-                 (cues/cue :hex-dimmers (fn [var-map] (dimmer-effect
-                                                       (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                       (show/fixtures-named "hex")
-                                                       :effect-name "Hex Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 5 2
-                 (cues/cue :puck-dimmers (fn [var-map] (dimmer-effect
-                                                        (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                        (show/fixtures-named "puck")
-                                                        :effect-name "Puck Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 6 2
-                 (cues/cue :snowball-dimmers (fn [var-map] (dimmer-effect
-                                                            (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                            (show/fixtures-named "snowball")
-                                                            :effect-name "Snowball Dimmers"))
-                           :variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
-                           :color :yellow :end-keys [:dimmers]))
+    (make-dimmer-cue nil 0 2 :yellow)
+    (doall (map-indexed (fn [i group] (make-dimmer-cue group (inc i) 2 :yellow)) light-groups))
 
     ;; TODO: Write a macro to make it easier to bind cue variables?
     (ct/set-cue! (:cue-grid *show*) 7 2

                                       {:key "fade-time" :name "Fade" :min 1 :max 2000 :start 50 :type :integer}]))


    ;; Dimmer oscillator cues: Sawtooth 
    (make-sawtooth-cue "All Sawtooth" 0 3 :dimmers (show/all-fixtures) :color :yellow
                       :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers :puck-dimmers :hex-dimmers
                                  :snowball-dimmers])

    (make-sawtooth-cue "Torrent Saw" 1 3 :torrent-dimmers (show/fixtures-named "torrent") :color :orange
                       :end-keys [:dimmers])

    (make-sawtooth-cue "Blade Saw" 2 3 :blade-dimmers (show/fixtures-named "blade") :color :orange
                       :end-keys [:dimmers])

    (make-sawtooth-cue "WS Saw" 3 3 :ws-dimmers (show/fixtures-named "ws") :color :orange
                       :end-keys [:dimmers])

    (make-sawtooth-cue "Hex Saw" 4 3 :hex-dimmers (show/fixtures-named "hex") :color :orange
                       :end-keys [:dimmers])

    (make-sawtooth-cue "Puck Saw" 5 3 :puck-dimmers (show/fixtures-named "puck") :color :orange
                       :end-keys [:dimmers])

    (make-sawtooth-cue "Snowball Saw" 6 3 :snowball-dimmers (show/fixtures-named "snowball") :color :orange
                       :end-keys [:dimmers])

    (ct/set-cue! (:cue-grid *show*) 7 3
                 (cues/cue :sawtooth-down? (fn [_] (var-fx/variable-effect @var-binder :sawtooth-down? false))
                           :color :red :short-name "Saw Up"))

    ;; Dimmer oscillator cues: Triangle
    (make-triangle-cue "All Triangle" 0 4 :dimmers (show/all-fixtures) :color :orange
                       :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers :puck-dimmers :hex-dimmers
                                  :snowball-dimmers])

    (make-triangle-cue "Torrent Triangle" 1 4 :torrent-dimmers (show/fixtures-named "torrent") :color :red
                       :end-keys [:dimmers])

    (make-triangle-cue "Blade Triangle" 2 4 :blade-dimmers (show/fixtures-named "blade") :color :red
                       :end-keys [:dimmers])

    (make-triangle-cue "WS Triangle" 3 4 :ws-dimmers (show/fixtures-named "ws") :color :red
                       :end-keys [:dimmers])

    (make-triangle-cue "Hex Triangle" 4 4 :hex-dimmers (show/fixtures-named "hex") :color :red
                       :end-keys [:dimmers])

    (make-triangle-cue "Puck Triangle" 5 4 :puck-dimmers (show/fixtures-named "puck") :color :red
                       :end-keys [:dimmers])

    (make-triangle-cue "Snowball Triangle" 6 4 :snowball-dimmers (show/fixtures-named "snowball") :color :red
                       :end-keys [:dimmers])

    ;; Dimmer oscillator cues: Sine
    (make-sine-cue "All Sine" 0 5 :dimmers (show/all-fixtures) :color :cyan
                   :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers :puck-dimmers :hex-dimmers
                              :snowball-dimmers])

    (make-sine-cue "Torrent Sine" 1 5 :torrent-dimmers (show/fixtures-named "torrent") :color :blue
                       :end-keys [:dimmers])

    (make-sine-cue "Blade Sine" 2 5 :blade-dimmers (show/fixtures-named "blade") :color :blue
                       :end-keys [:dimmers])

    (make-sine-cue "WS Sine" 3 5 :ws-dimmers (show/fixtures-named "ws") :color :blue
                       :end-keys [:dimmers])

    (make-sine-cue "Hex Sine" 4 5 :hex-dimmers (show/fixtures-named "hex") :color :blue
                       :end-keys [:dimmers])

    (make-sine-cue "Puck Sine" 5 5 :puck-dimmers (show/fixtures-named "puck") :color :blue
                       :end-keys [:dimmers])

    (make-sine-cue "Snowball Sine" 6 5 :snowball-dimmers (show/fixtures-named "snowball") :color :blue
                       :end-keys [:dimmers])

    (ct/set-cue! (:cue-grid *show*) 7 5
                 (cues/cue :beat-ratio

                                     {:key "cycles" :min 1 :max 10 :type :integer :start :starting-cycles
                                      :name "Cycles"}
                                     {:key "width" :min 0 :max 1 :start :starting-width :name "Width"}]
                         :end-keys end-keys))))

(defn x-phase
  "Return a value that ranges from zero for the leftmost fixture in a
