[CM] cl/clm mutliple combs

James Hearon j_hearon at hotmail.com
Tue Jun 24 11:55:10 PDT 2014


Hi,
I'm stuck on a bit of info from snd/clm manual re: summing combs. I was able to do it in snd/clm using comb-bank, but I'm stuck on cl/clm approach where you need to loop thru and sum the combs.  Hoping I can get some help with my code, below. I may have made a mess of it, but can't seem to figure out how to do it.  Thank you.

 (let ((sum 0.0)) 
  (do ((i 0 (+ i 1)))
      ((= i n) sum)
    (set! sum (+ sum (comb (combs i) x)))))

can be replaced with:

(let ((cb (make-comb-bank combs)))
  ...
  (comb-bank cb x))

----------------
error:
The LET* binding spec (COMBS 1 (MAKE-COMB 1.0 600)) is malformed.

(definstrument mult-combs (beg dur freq amp)
  (let* ((start (floor (* beg *srate*)))
     (end (+ start (floor (* dur *srate*))))
     (os (make-oscil freq))
     (combs 1 (make-comb 1.0 600))
     (combs 2 (make-comb 2.0 300))
     (combs 3 (make-comb 3.0 100))
     (sum 0.0) ) 
    (do ((i 0 (+ i 1))) 
    ((= i 3) sum)    
    (set! sum (+ sum (comb (combs i) 0.02))) )
     (run
     (loop for i from start to end do
   (outa i (comb sum (* amp (oscil os))))    
   (outb i (comb sum (* amp (oscil os)))) ))))
       
 (with-sound (:channels 2 :srate 48000 :header-type mus-riff :output "mytest.wav")
   (mult-combs 0 5 200 .8)
 )
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20140624/a01c45fb/attachment.html 


More information about the Cmdist mailing list