            shift (* (metro-tick metro) (if (> phase 0.5) (dec phase) phase))
            new-bar-start (round (- (now) shift (* (dec start-bar) (metro-tock metro))))]
        (ref-set start new-bar-start))))
+
   (metro-phrase-start [metro start-phrase]
     (dosync
      (ensure bpm)


(defrecord Metronome [start bpm bpb bpp]
  IMetronome
  (metro-start [metro] @start)
  (metro-start [metro start-beat]
    (dosync
     (ensure bpm)
     (let [new-start (round (- (now) (* (dec start-beat) (metro-tick metro))))]
       (ref-set start new-start))))
  (metro-bar-start [metro start-bar]
    (dosync
     (ensure bpm)

  fluke in timing as their evaluation occurs over time. Snapshots also
  extend the notions of beat phase to enable oscillators with
  frequencies that are fractions or multiples of a beat."

  (snapshot-beat-phase [snapshot] [snapshot beat-ratio]
  "Determine the metronome's phase at the time of the snapshot with
  respect to a multiple or fraction of beats. Calling this with a
