anchor.diff:  
   Example:
   
  -;; (define-event-special-key amp ((:db (db-amp (raw-event-value event :db)))
  -;;                                (t 0.5))
  +;; (define-event-special-key :amp ((:db (db-amp (raw-event-value event :db)))
  +;;                                 (t 0.5))
   ;;   :define-methods t)
   
  -This defines the amp key for events. Since the :amp KEY is implied, it doesn't need to be specified in the CASES. Thus if the event already has an :amp key, its value will be used by default. If no :amp key exists in the event, then the :db FUNC is run if the :db key exists. If neither :amp nor :db exist in the event, then the t key is run, giving a default of 0.5.
  +This defines the amp key for events. Since the :amp key is implied, it doesn't need to be specified in the CASES. Thus if the event already has an :amp key, its value will be used by default. If no :amp key exists in the event, then the :db FUNC is run if the :db key exists. If neither :amp nor :db exist in the event, then the t key is run, giving a default of 0.5.
   
   Additionally, because :define-methods is true, we can also do the following:
   
  
positive.code: See also: `event', `e', `raw-event-value'"
    (when (eop-p event)
      (return-from event-value (values nil nil)))
    (let* ((key (make-keyword key))
           (cases (car (getf *event-special-keys* key)))
           (cases (if (not (position key (keys cases))) ;; FIX: move this to when the special-key is defined instead?
                      (append (list key (lambda (event) (raw-event-value event key))) cases)
                      cases))
  
negative.code: ;; (amp *foo*) ; => 0.9
  ;; (setf (amp *foo*) 0.7)"
    ;; FIX: does not handle cases with multiple keys. (i.e. (((:foo :bar) 5)))
    (unless (position name (mapcar #'car cases))
      (setf cases (cons (list name (list 'raw-event-value 'event name)) cases)))
    `(progn
       (setf *event-special-keys*
             (plist-set *event-special-keys* ,name (list
                                                    (list ,@(loop
                                                              :for case :in cases
                                                              :for key := (car case)
                                                              :for value := (cadr case)
                                                              :append (list
                                                                       key
                                                                       `(lambda (event)
                                                                          (declare (ignorable event))
                                                                          ,value))))
                                                    (list ,@(ensure-list remove-keys)))))
       ,(when define-methods
          (let ((clp-name (ensure-symbol name 'cl-patterns)))
            `(progn
               ,(when documentation
                  `(defgeneric ,clp-name (object)
                     (:documentation ,documentation)))
               (defmethod ,clp-name ((event event))
                 (event-value event ,name))
               (defmethod (setf ,clp-name) (value (event event))
                 (setf (event-value event ,name) value)))))))
  
  ;;; type
  
  (define-event-special-key :type ((t :note)))
  
  ;;; instrument/group/out
  
  (define-event-special-key :instrument ((t :default))
    :define-methods t
    :documentation "The instrument or synth to trigger.")
  
  (define-event-special-key :group ((t 1)))
  
  (define-event-special-key :out ((t 0)))
  
  ;;; amp/pan
  
  (define-event-special-key :amp ((:db (db-amp (raw-event-value event :db)))
                                  (t 0.5))
    :define-methods t
    :documentation "Volume in amplitude, from 0 to 1.")
  
  (define-event-special-key :db ((:amp (amp-db (raw-event-value event :amp)))
                                 (t (amp-db 0.5)))
    :define-methods t
    :documentation "Volume in decibels (dB).")
  
  (define-event-special-key :pan ((t 0))
    :define-methods t
    :documentation "Stereo panning, where -1 is fully left, 1 is fully right, and 0 is center.")
  
  ;;; dur/delta
  
  (define-event-special-key :tempo ((t (if (and (boundp '*clock*) (not (null *clock*)))
                                           (values (tempo *clock*) :tempo)
                                           1))))
  
  (define-event-special-key :beat ((t (or (raw-event-value event :beat)
                                          (slot-value event '%beat)))))
  
  (define-event-special-key :delta ((:dur (event-value event :dur))
                                    (t (event-value event :dur)))
    :remove-keys nil
    :define-methods t
    :documentation "The number of beats between the start of this event and the start of the next one.
  
  See also: `dur', `sustain'")
  
  (define-event-special-key :dur ((t 1))
    :remove-keys nil
    :define-methods t
    :documentation "The total duration of the note, in beats.
  