anchor.diff:  ;; (setf (amp *foo*) 0.7)"
     ;; FIX: does not handle cases with multiple keys. (i.e. (((:foo :bar) 5)))
     (let ((kwname (make-keyword name)))
  -    (unless (position kwname (keys cases))
  -      (setf cases (append (list kwname (list 'raw-event-value 'event kwname)) cases)))
  +    (unless (position kwname (mapcar #'car cases))
  +      (setf cases (cons (list kwname (list 'raw-event-value 'event kwname)) cases)))
       `(progn
          (setf *event-special-keys*
                (plist-set *event-special-keys* ,kwname (list
  -                                                      (list ,@(loop :for (key value) :on cases :by #'cddr
  +                                                      (list ,@(loop :for case :in cases
  +                                                                 :for key = (car case)
  +                                                                 :for value = (cadr case)
                                                                    :append (list
                                                                             (if (eql key t)
                                                                                 key
  
positive.code: 
  ;;; timing
  
  (define-event-special-key timing-offset (t 0))
  
  (define-event-special-key quant (:quant (ensure-list (raw-event-value event :quant))
                                   t (list 1))
    :define-methods t)
  
  ;;; pitch
  
  (define-event-special-key freq (:midinote (midinote-freq (event-value event :midinote))
                                  :degree (degree-freq (event-value event :degree)
                                                       :root (event-value event :root)
                                                       :octave (event-value event :octave)
                                                       :scale (event-value event :scale))
                                  t 440)
    :remove-keys (:midinote :degree :root :octave)
    :define-methods t
    :documentation "Frequency of the note, in Hz.
  
  See also: `rate', `midinote', `degree'")
  
  (define-event-special-key midinote (:freq (freq-midinote (event-value event :freq))
                                      :degree (degree-midinote (event-value event :degree)
                                                               :root (event-value event :root)
                                                               :octave (event-value event :octave)
                                                               :scale (event-value event :scale))
                                      t 69)
    :remove-keys (:freq :degree :root :octave)
    :define-methods t
    :documentation "MIDI note number of the note (0-127).")
  
  ;; FIX: this can return NIL. i.e. (degree (event :midinote 0))
  (define-event-special-key degree (:freq (midinote-degree (freq-midinote (event-value event :freq))
                                                           :root (event-value event :root)
                                                           :octave (event-value event :octave)
                                                           :scale (event-value event :scale))
                                    :midinote (midinote-degree (event-value event :midinote)
                                                                     :root (event-value event :root)
                                                                     :octave (event-value event :octave)
                                                                     :scale (event-value event :scale))
                                    t 5)
    :remove-keys (:freq :midinote))
  
  (define-event-special-key root (t 0) ;; FIX: can we derive this when :freq, :midinote, :degree, etc are available?
    :remove-keys (:freq :midinote))
  
  (define-event-special-key octave (:freq (freq-octave (raw-event-value event :freq))
                                    :midinote (midinote-octave (raw-event-value event :midinote))
                                    t 5)
    :remove-keys (:freq :midinote))
  
  (define-event-special-key scale (t :major)
    :remove-keys (:freq :midinote)
    :define-methods t)
  
  (define-event-special-key base-freq (:base-note (midinote-freq (event-value event :base-note))
                                       t 440))
  
  (define-event-special-key base-note (:base-freq (freq-midinote (event-value event :base-freq))
                                       t 69))
  
  (define-event-special-key rate (t (let ((res (multiple-value-list (event-value event :freq))))
                                      (values (freq-rate (car res) (event-value event :base-freq))
                                              (cadr res))))
    ;; we don't do remove-keys because other frequency keys are not exact synonyms.
    ;; it's also conceivable that some instruments may use both :rate and :freq.
    :define-methods t
  
negative.code: 
  ;;; 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 ((:delta (raw-event-value event :delta))
                                 (t 1))
    :remove-keys nil
    :define-methods t
    :documentation "The total duration of the note, in beats.
  