anchor.diff:            (append plist (list key value)))))
   
   (defun event-plist (event)
  -  "Convert EVENT into a plist."
  +  "Return EVENT as a plist."
     (slot-value event 'other-params))
   
   (defmethod print-object ((item event) stream)
     (format stream "(~s~{ ~s ~s~})" 'event (event-plist item)))
   
  -(defmacro define-event-special-slot (name cases &optional (remove-keys t))
  +(defmacro define-event-special-slot (name cases &key (remove-keys t))
     "Define a special slot with the key NAME for events (i.e. slots that take their values from other slots, or slots that have default values).
   
   CASES is a plist of cases mapping event slot names to forms. When `get-event-value' is called on an event for the NAME slot, 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 `get-event-value'.
   
   If no case is provided with a KEY that's the same as NAME, one is automatically added at the start with a form that just returns the value of the event's NAME slot. If a case is provided with t as its KEY, that case is always run when found. This allows you to set a default value for the slot if none of the other keys from CASES exist in the event.
   
  -REMOVE-KEYS is a list of keys to remove from the event when the NAME key is being set with `set-event-value'. If t, all keys in CASES will be removed from the event.
  +REMOVE-KEYS is a list of keys to remove from the event when the NAME key is being set with `set-event-value'. If t (the default), all keys in CASES will be removed from the event.
   
   Example:
   (define-event-special-slot amp (:db (db-amp (raw-get-event-value event :db))
  
positive.code:                 (funcall func event))
              key)))
  
  (defun combine-events (&rest events)
    "Returns an event that inserts all the items in each event of EVENTS. Keys from the events listed first will be overwritten by later events."
    (let ((result (event)))
      (loop :for ev :in events
         :do
         (loop :for key :in (keys ev)
            :do (set-event-value result key (get-event-value ev key))))
      result))
  
  (defun play-test (item &optional pstream)
    "Simply output information about the event that's being played. Useful for diagnostics when no audio output is available."
  
negative.code: 
  (define-event-special-slot delta (:dur (get-event-value event :dur)
                                         t (get-event-value event :dur))
    :remove-keys nil)
  
  (defgeneric delta (item))
  
  (defmethod delta ((item event))
    (get-event-value item :delta))
  
  ;; (defgeneric (setf delta) (value item))
  
  ;; (defmethod (setf delta) (value (item event))
  ;;   (set-event-value item :delta value))
  
  (define-event-special-slot dur (:delta (raw-get-event-value event :delta)
                                         t 1)
    :remove-keys nil)
  
  (defgeneric dur (item))
  
  (defmethod dur ((item event))
    (get-event-value item :dur))
  
  ;; (defgeneric (setf dur) (value item))
  
  ;; (defmethod (setf dur) (value (item event))
  ;;   (set-event-value item :dur value))
  
  ;; sustain/legato
  
  (define-event-special-slot sustain (t (* (get-event-value event :legato)
                                           (get-event-value event :dur)))
    :remove-keys (:legato))
  
  (defgeneric sustain (item))
  
  (defmethod sustain ((item event))
    (get-event-value item :sustain))
  
  ;; (defgeneric (setf sustain) (value item))
  
  ;; (defmethod (setf sustain) (value (item event))
  ;;   (set-event-value item :sustain value))
  
  (define-event-special-slot timing-offset (t 0))
  
  (define-event-special-slot legato (:sustain (* (raw-get-event-value event :sustain)
                                                 (get-event-value event :dur))
                                              t 0.8)
    :remove-keys (:sustain))
  
  (defgeneric legato (item))
  
  (defmethod legato ((item event))
    (get-event-value item :legato))
  
  ;; (defgeneric (setf legato) (value item))
  
  ;; (defmethod (setf legato) (value (item event))
  ;;   (set-event-value item :legato value))
  
  ;;; quant
  
  