anchor.diff:      :pty cl:*standard-output*))
   
   (defun unclip (x range)
  -  (integer (+ (half (- 16 range)) (* (/ x 16) range))))
  +  (integer (number+ (half (- 16 range)) (* (/ x 16) range))))
   
   (defun nipkow-average-pulse ()
     (integer (/ (cpu-cycles *tv*) *nipkow-pulse-rate* 8)))
  
positive.code:       (write-byte average out))
      (awhile (read-byte in)
              nil
        (write-byte (+ shortest (bit-xor (>> ! 4) 8)) out)
        (write-byte (+ shortest (bit-xor (bit-and ! 15) 8)) out))
      (adotimes pause-after
        (write-byte average out))))
  
  
negative.code:   (- (nipkow-average-pulse) 8))
  
  (defun nipkow-longest-pulse ()
    (number+ (nipkow-average-pulse) 8))
  
  (defun wav2pwm (out in &key video (pause-before 16000) (pause-after 16000) (skip-first 0))
    (format t "Converting WAV to 4–bit PWM. Skipped: ~A, before ~A, after ~A~%"
              skip-first pause-before pause-after)
    (= (stream-track-input-location? in) nil)
    (adotimes ((number+ 44 skip-first))
      (read-byte in))
    (with (shortest  (nipkow-shortest-pulse)
           average   (nipkow-average-pulse))
  