anchor.diff:  (defmethod print-object ((item event) stream)
     (format stream "(~s~{ ~s ~s~})" 'event (event-plist item)))
   
  -(defmacro define-event-special-key (name cases &key (remove-keys t) (define-methods nil))
  +(defmacro define-event-special-key (name cases &key (remove-keys t) (define-methods nil) documentation)
     "Define a special key with the key NAME for events (i.e. keys that take their values from other keys, or keys that have default values).
   
   CASES is a plist of cases mapping event key names to forms. When `event-value' is called on an event for the NAME key, then the event is tested for the keys of CASES in the order they're listed. The associated form of the first key of CASES that exists in the event is evaluated to get the value of that call to `event-value'.
  
positive.code:                                                       (list ,@(ensure-list remove-keys)))))
         ,(when define-methods
            `(progn
               (defmethod ,name ((event null)) nil)
               (defmethod ,name ((event event))
                 (event-value event ,kwname))
  
negative.code:                                                          :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
    :documentation "Playback rate, i.e. for playing back sound buffers. 1 is normal speed, 2 is twice as fast, 0.5 half as fast, etc.")
  