anchor.diff:  
   (defun clock-process-task (task clock) ;; FIX: only remove patterns if they've returned NIL as their first output 4 times in a row.
     "Process TASK on CLOCK. This function processes meta-events like tempo changes, etc, and everything else is sent to to *EVENT-OUTPUT-FUNCTION*."
  -  (with-slots (beats tempo granularity timestamp-at-tempo time-at-tempo when-tempo-changed) clock
  +  (with-slots (beats tempo granularity timestamp-at-tempo when-tempo-changed) clock
       (when (null (slot-value task 'next-time)) ;; pstream hasn't started yet.
         (setf (slot-value task 'start-time) beats
               (slot-value task 'next-time) beats))
  
positive.code: (defun absolute-beats-to-timestamp (beats clock)
    "Convert a clock's number of beats to a timestamp. The result is only guaranteed to be accurate if it's greater than the clock's when-tempo-changed slot."
    (with-slots (timestamp-at-tempo when-tempo-changed) clock
      (local-time:timestamp+ timestamp-at-tempo (dur-time (- beats when-tempo-changed) (tempo clock)) :sec)))
  
  (defun absolute-beats-to-internal-time (beats clock)
    "Convert a clock's number of beats to an internal real time. The result is only guaranteed to be accurate if it's greater than the clock's when-tempo-changed slot."
    (with-slots (time-at-tempo when-tempo-changed) clock
      (+ time-at-tempo (* internal-time-units-per-second (dur-time (- beats when-tempo-changed) (tempo clock))))))
  
  (defun make-clock (&optional (tempo 1) tasks)
    "Create a clock. The clock automatically starts running in a new thread."
  
negative.code:    (tasks :initform nil :documentation "The list of tasks that are running on the clock.")
     (tasks-lock :initform (bt:make-lock) :documentation "The lock on the tasks to make the clock thread-safe.")
     (timestamp-at-tempo :initform (local-time:now) :documentation "The local-time timestamp when the tempo was last changed.")
     (when-tempo-changed :initform 0 :documentation "The number of beats on the clock when the tempo was last changed.")))
  
  (defmethod (setf tempo) (value (item clock))
  