anchor.diff:                               :direction :output
                                :chanls +num-channels+
                                :sr (floor +sample-rate+))
  -                        (sf:write-frames-float (flatten input) snd)))
  +                        (sf:write-frames-float input snd)))
   
   (defun sample-region (fun start end)
     (loop for i from 0 below (round (* (- end start) +sample-rate+))
  -        collect (map 'list (lambda (x) (coerce x 'single-float))
  -                     (funcall fun (+ start (/ i +sample-rate+))))))
  +        append (map 'list (lambda (x) (coerce x 'single-float))
  +                    (funcall fun (+ start (/ i +sample-rate+))))))
  +
  +(defun normalize (samples)
  +  (let ((maximum (reduce 'max (map 'list 'abs samples))))
  +    (if (= 0 maximum)
  +      samples
  +      (loop for frame in samples
  +            collect (/ frame maximum)))))
   
   ; MIXING
   (defun channel-up (x)
  
positive.code: (defmethod fade ((frame list) (fader list))
    (map 'list '* frame fader))
  
  (defun normalize (samples)
    (let ((maximum (reduce 'max (map 'list 'abs (flatten samples)))))
      (if (= 0 maximum)
        samples
        (loop for frame in samples
              collect (fade frame (/ 1 maximum))))))
  
  ; SEQUENCING
  (defun sequence-cut (tm tracks interval)
    (funcall (aref tracks (mod (floor (/ tm interval)) (length tracks))) tm))
  
negative.code: ; UTILITIES
  (defun partial (func &rest args1)
    (lambda (&rest args2) (apply func (append args1 args2))))
  
  (defun to-signed (x)
    (- 1 (* 2 x)))
  