anchor.diff:    (let ((len (or size (length fn))))
       (if (< x 0.0) (incf x len))
       (multiple-value-bind
  -	(int-part frac-part) 
  +	(int-part frac-part)
   	(truncate x)
         (if (>= int-part len)
   	  (setf int-part (mod int-part len)))
  -      (if (zerop frac-part) 
  +      (if (zerop frac-part)
   	  (aref fn int-part)
   	(+ (aref fn int-part)
   	   (* frac-part (- (aref fn (if (< (1+ int-part) len) (1+ int-part) 0))
  
positive.code:   (yscl 0.0)
    (type :mus-interp-none))
  
  (defun new-delay (size initial-contents initial-element max-size type)
    (let ((lsize (round (or max-size size))))
      (make-instance 'delay
       :loc 0
       :size (floor size)
       :zsize lsize
       :zdly max-size
       :zloc (and max-size (- max-size size))
       :line (if initial-contents 
  	       (make-double-array lsize :initial-contents initial-contents)
  	       (if initial-element
  		   (make-double-array lsize :initial-element (double initial-element))
  		   (make-double-array lsize)))
       :type (or type
  	       (if max-size
  		   :mus-interp-linear
  		   :mus-interp-none)))))
  
  (defun tap (d &optional (offset 0.0))
    (if (delay-zdly d)
        (if (= offset 0.0) 
  	  (aref (delay-line d) (delay-zloc d))
  	(array-interp (delay-line d) (- (delay-zloc d) offset) (delay-zsize d)))
      (if (= offset 0.0) 
  	(aref (delay-line d) (delay-loc d))
        (aref (delay-line d) (floor (mod (- (delay-loc d) offset) (delay-size d)))))))
  	  
  (defun delay-tick (d input)
    (setf (aref (delay-line d) (delay-loc d)) (double input))
    (incf (delay-loc d))
  
negative.code:     (setf (triangle-wave-current-value s) (tri-val (triangle-wave-base s) (triangle-wave-phase s)))))
  
  ;;;;square-wave
  (defstruct (square-wave (:include triangle-wave)
  			(:constructor %make-square-wave (current-value freq phase base width)))
    (width))
  
  (defun make-square-wave (&optional (frequency *default-frequency*) (amplitude 1.0) (initial-phase 0.0))
    (%make-square-wave
     (if (< initial-phase pi) 0.0 amplitude)
     (hz->radians frequency)
     initial-phase
     amplitude
     pi))
  
  (defun square-wave (s &optional (fm 0.0))
    (prog1
        (square-wave-current-value s)
      (incf (square-wave-phase s) (+ (square-wave-freq s) fm))
      (if (or (minusp (square-wave-phase s))
  	    (>= (square-wave-phase s) +two-pi+))
  	(fix-up-phase s))
      (setf (square-wave-current-value s) (if (< (square-wave-phase s) (square-wave-width s)) (square-wave-base s) 0.0))))
  
  ;;;;sawtooth-wave
  (defstruct (sawtooth-wave (:include triangle-wave)
  			  (:constructor %make-sawtooth-wave (current-value freq phase base))))
  
  (defun make-sawtooth-wave (&optional (frequency *default-frequency*) (amplitude 1.0) (initial-phase pi))
    (%make-sawtooth-wave
  		 (* amplitude (/ (- initial-phase pi) pi))
  		 (hz->radians frequency)
  		 initial-phase
  		 (/ amplitude pi)))
  
  (defun sawtooth-wave (s &optional (fm 0.0))
    (prog1
  