anchor.diff:          (tri 1 (* pitch 2/3))
           (tri 1 (* pitch 1/2)))))
   
  +(defun bthump (length pitch)
  +  (segment length
  +    (para (thump length pitch)
  +          #+NIL
  +          (note 1 8 (* 4.0 pitch) :d 6 :cfg '(:duty 1 :vol 12 :loop nil))
  +          (seq
  +           (note 0 1 (* 2.0 pitch) :cfg '(:duty 2 :vol 2 :loop nil))
  +           (note 0 1 (* 4.0 pitch) :cfg '(:duty 2 :vol 2 :loop nil))
  +           (note 0 1 (* 2.0 pitch) :cfg '(:duty 2 :vol 2 :loop nil))))))
  +
  +(defun shaker (length volume)
  +  (assert (>= length 2))
  +  (segment
  +   length
  +   (seq
  +    (noise 1 1 1 :env nil :loop t :vol volume)
  +    (noise 1 1 1 :env nil :vol 0))))
  +
   (defun rst (length) (segment length nil))
   
  -
  +(defun eltmod (i seq) (elt seq (mod i (length seq))))
  +(defun clamp (x min max) (max (min x max) min))
  +
  +(defun arp-test ()
  +  (apply 'seq
  +         (loop for i below 128
  +               as freq = (et (eltmod i '(0 3 5 -2 -4)) 12)
  +               as vol = (clamp (ash (- 48 i) -2)
  +                               0
  +                               15)
  +               as duty = (mod (ash i -2) 4)
  +               collect
  +               (para (note 0 3 freq :cfg (list :duty duty :env nil :loop t :vol vol))
  +                     (note 1 3 (* freq 1.01) :cfg (list :duty duty :env nil :loop t :vol vol))))))
  +
  +(defun arp-test-2 ()
  +  (para
  +   (apply 'seq
  +          (loop for i below 128
  +                as time = (* i 3)
  +                as freq = (et (eltmod i '(0 3 5 -2 -4)) 12)
  +                as vol = (clamp (- 15 (ash time -3))
  +                                0
  +                                15)
  +                as duty = (mod (ash time -2) 4)
  +                collect
  +                (note 0 3 freq :cfg (list :duty duty :env nil :loop t :vol vol))))
  +   (apply 'seq
  +          (loop for i below 128
  +                as time = (* i 4)
  +                as freq = (et (eltmod i '(0 2 5 -2 -4 7)) 12)
  +                as vol = (clamp (- 15 (ash time -3))
  +                                0
  +                                15)
  +                as duty = (mod (ash time -2) 4)
  +                collect
  +                (note 1 4 freq :cfg (list :duty duty :env nil :loop t :vol vol))))))
  +
  +(defun silence-channel (channel)
  +  (ecase channel
  +    (0 (note 0 1 1 :d 0 :cfg '(:vol 0 :loop t :env nil)))
  +    (1 (note 1 1 1 :d 0 :cfg '(:vol 0 :loop t :env nil)))))
  +
  +(defun volramp (&optional (start 15) (rate -1/10))
  +  (lambda (time)
  +   (clamp (round (+ start (* time rate)))
  +          0
  +          15)))
  +
  +(defun shimmer ()
  +  (lambda (time) (mod (ash time -4) 4)))
  +
  +(defun arpeggio (channel length chord &key
  +                 (rate 3)
  +                 (d rate)
  +                 (env nil)
  +                 (loop t)
  +                 (mute nil)
  +                 (volume (volramp))
  +                 (duty (shimmer)))
  +  (segment length
  +           (para
  +            (loop for time below length by rate
  +                  for index upfrom 0
  +                  append (note channel rate (eltmod index chord)
  +                               :d d
  +                               :cfg (list :duty (funcall duty time)
  +                                          :vol (funcall volume time)
  +                                          :env env
  +                                          :loop loop)))
  +            (seq
  +             (rst (1- length))
  +             (and mute (silence-channel channel))))))
  +
  +(defun fat-arp (length chord &rest args)
  +  (para
  +   (apply #'arpeggio 0 length (apply #'chord (- (first chord) 0.08) (rest chord)) args)
  +   (apply #'arpeggio 1 length (apply #'chord (+ (first chord) 0.08) (rest chord)) args)))
  +
  +(defun chord (root &rest notes)
  +  (mapcar (lambda (note) (et root note)) notes))
   
   (defun wait (&optional (frames 20))
     (ldx (imm frames))
  
positive.code: (defun para (&rest args)
    (apply #'mapcar #'append (mapcar (lambda (x) (pad-list x nil (reduce #'max args :key #'length))) args)))
  
  ;;; These look familiar:
  (defun seq (&rest args)
    (apply #'concatenate 'list args))
  
negative.code:   (first
     (first
      (sort
       (copy-list
        '((0 #x0A)  (1 #xFE)
          (2 #x14)  (3 #x02)
          (4 #x28)  (5 #x04)
          (6 #x50)  (7 #x06)
          (8 #xA0)  (9 #x08)
          (10 #x3C) (11 #x0A)
          (12 #x0E) (13 #x0C)
          (14 #x1A) (15 #x0E)
          (16 #x0C) (17 #x10)
          (18 #x18) (19 #x12)
          (20 #x30) (21 #x14)
          (22 #x60) (23 #x16)
          (24 #xC0) (25 #x18)
          (26 #x48) (27 #x1A)
          (28 #x10) (29 #x1C)
          (30 #x20) (31 #x1E)))
       #'<
       :key (lambda (p) (abs (- (second p) length)))))))
  
  (defun cfg (channel &key (duty 2) (vol 15) (env t) (loop nil))
    (list
  