   The function supplied with `:transition-phase-function` determines
   precisely when the transition takes place and how quickly it occurs.
   It is also called with the show metronome snapshot, and if the value
-  it returns is zero or less, the transition is considered not to have
-  started yet, and no fixtures will be assigned the current color.
-  Values between zero and one mean the transition is in progress, and
-  lights whose distance measure divided by the largest distance
-  measure is less than or equal to the current phase will change
-  color. Once the transition phase reaches one (or greater), the
-  transition is complete, and all lights will be assigned the color
-  associated with the current cycle index. The default transition
-  phase function causes the transition to be spread over the down beat
-  of each bar. Passing [[rhythm/snapshot-bar-phase]] instead would
-  spread the transition over the entire bar, so that transitions would
-  be feeding right into each other. Other possibilities are limited
-  only by your imagination, although for the transition mechanics to
-  work correctly with respect to assigning old and new color values,
-  it should always start at (or below) zero and progress to one (or
-  beyond). It can pause and reverse directions while in between those
-  extremes, but if you want to reverse the direction of the full
-  transition, do it by reversing the distance measure, not the phase
-  function.
+  it returns is less than zero, the transition is considered not to
+  have started yet, and no fixtures will be assigned the current
+  color. Values between zero and one mean the transition is in
+  progress, and lights whose distance measure divided by the largest
+  distance measure is less than or equal to the current phase will
+  change color. Once the transition phase reaches one (or greater),
+  the transition is complete, and all lights will be assigned the
+  color associated with the current cycle index. The default
+  transition phase function, [[transition-during-down-beat]], causes
+  the transition to be spread over the down beat of each bar.
+  Passing [[rhythm/snapshot-bar-phase]] instead would spread the
+  transition over the entire bar, so that transitions would be feeding
+  right into each other. Other possibilities are limited only by your
+  imagination, although for the transition mechanics to work correctly
+  with respect to assigning old and new color values, it should always
+  start at (or below) zero and progress to one (or beyond). It can
+  pause and reverse directions while in between those extremes, but if
+  you want to reverse the direction of the full transition, do it by
+  reversing the distance measure, not the phase function.
 
   To give your running effect a meaningful name within user
   interfaces, pass a short and descriptive value with `:effect-name`."

               (fn [snow snapshot]  ;; Arrange to shut down at the end of a measure
                 (reset! running false))))))

(def default-sparkle-color
  "The default color for the sparkle effect."
  (colors/create-color "white"))

(defn- remove-finished-sparkles

           (afterglow.rhythm Metronome)
           (javax.vecmath Point3d)))

(def ^{:doc/format :markdown} default-down-beat-color
  "The default color for [[metronome-effect]] to flash on the down
  beats."
  (colors/lighten (colors/create-color :red) 20))

(def ^{:doc/format :markdown} default-other-beat-color
  "The default color for [[metronome-effect]] to flash on beats that
  are not down beats."
  (colors/darken (colors/create-color :yellow) 30))

(defn metronome-effect
  "Returns an effect which flashes the supplied fixtures to the beats
  of the show metronome, emphasizing the down beat, which is a great
  way to test and understand metronome synchronization. The color of
  the flashes can be controlled by the `:down-beat-color` and
  `:other-beat-color` optional keyword arguments (defaulting to red
  with lightness 70, and yellow with lightness 20, respectively).

  This is no longer as useful as it used to be before there were
  metronome adjustment interfaces in the Ableton Push and then web
  interfaces, but is still an example of how to write a metronome
  driven effect, and can be synchronized to metronomes other than the
  default show metronome by passing them in with optional keyword
  argument `:metronome`."
  {:doc/format :markdown}
  [fixtures & {:keys [down-beat-color other-beat-color metronome]
               :or {down-beat-color default-down-beat-color
                    other-beat-color default-other-beat-color
