[CM] tap and comb pm arguments

cristopher pierson ewing cewing@u.washington.edu
Thu, 13 Feb 2003 18:30:36 -0800 (PST)

I've been testing tap and comb in pursuit of building some simple
delay-line based DSP instruments (a chorus, a flanger, etc.) and I've
managed to hunt down a strange problem, it appears that the pm argument to
tap and comb does not work as advertised.

I've included a few chunks of code below that should demonstrate what I

Are these bugs? Or am I misunderstanding what I'm reading in the manual?

thanks for checking,


By the way, I'm using ACL6-1 under RedHat linux.

Code examps:

;;by my reading, the p.m. argument to comb should work as an additive
;;value to the index into the delay.  I would expect then, that given
;;a ringing frequency of 400 hz (or del-time = (/ 1.0 400)), and a f-dif
;;value of 200, I would get a result where the left channel rings at 400
;;hz and the right rings at 600.  Instead, I get the left at 400 and the
;;right at 133.333.... Similarly, I would expect that del-time=(/ 1.0 400)
;;and f-dif = -500 would give a left-channel freq of 400 hz and a
;;right-channel freq of -100 (?).  But left = 400, right = 2000.  I'm sure
;;there must be something wrong about how I'm understanding this, but
;;could somebody point it out?
(definstrument comb-test (del-time dur f-dif)
  (let* ((samples (seconds->samples del-time))
         (end (seconds->samples dur))
         (s-dif (seconds->samples (/ 1.0 f-dif)))
         (c (make-comb 0.95 samples :max-size 44100))
         (c2 (make-comb 0.95 samples :max-size 44100))
         (sig 0.0))
    (print (list samples s-dif))
     (let ((comb 0.0)
           (comb2 0.0))
       (loop for i from 0 to end do
             (if (= i 441)
               (setf sig 1.0)
               (setf sig 0.0))
             (outa i (comb c sig))
             (outb i (comb c2 sig s-dif)))))))

;;And here is my test func for tap.
(definstrument del-test (del-time tap-offset)
  (let* ((samples (seconds->samples del-time))
         (d (make-delay samples :max-size 44100))
         (sig 0.0))
     (let ((del 0.0)
           (tap 0.0))
       (loop for i from 0 to 44099 do
             (if (= i 441)
               (setf sig 1.0)
               (setf sig 0.0))
             (setf del (delay d (+ sig (* 0.75 (tap d)))))
             (setf tap (tap d tap-offset))
             (outa i del)
             (outb i tap))))))

;;No matter what values i give for tap-offset, the right channel has
;;nothing in it at all. And if I try to give a third argument to tap, the
;;&optional pm, it complains that tap expects between 1 and 2 arguments.

Cris Ewing
CARTAH Assistant
University of Washington
Home Phone: (206) 365-3413
E-mail: cewing@u.washington.edu