[CM] Scheme, outa and reverb

James Hearon j_hearon at hotmail.com
Wed Apr 29 10:55:28 PDT 2015


                                                                                                              Scheme, Outa, and reverb                                                                                                                                                                                                                                                                                                       James Hearon                                                                                                                                                                                                                                                   4/28/15                                                                                                                                                                                                                                                                                                                                      To:  cmdist at ccrma.Stanford.EDU                                                                                                                                                                                                                                                                                                                                            


Hi,
I might have figured out a way to add the reverberator using outa and *reverb* in the definstrument, and calling it using a scheme process.  It may not be the best way but it seems to work...which is setting the *clm-reverb* global.  (Now I need to figure out how to unset it.)  TX.  Jim

(if (not (provided? 'jcrev.scm))

      (load "jcrev.scm"))

 (set! *clm-reverb* jc-reverb)

(definstrument (myexamp start-time duration frequency amplitude sampling-rate
      (reverb-amount 0.01))

  (let* ((beg (floor (* start-time sampling-rate)))

     (end (+ beg (floor (* duration sampling-rate))))

     (sine-wave (make-oscil :frequency frequency)))

     (do ((i beg (+ i 1)))

         ((= i end))  
(outa i (* (* (* amplitude (oscil sine-wave))) reverb-amount)  *reverb*)
(outb i (* (* (* amplitude (oscil sine-wave))) reverb-amount)  *reverb*)  
)))


(with-sound (:output "test.wav" :srate 48000 :channels 2

                     :data-format mus-lshort

                     :header-type  mus-riff
                     :reverb jc-reverb) 
(myexamp 0 1 440.0 0.5 48000 :reverb-amount 0.15))

;---------------------------------
;using a process
(define (call_myexamp n r d flb fub amp sr)

(process 

  for freq = (between flb fub)

  repeat n do

 (send "myexamp" (elapsed) d freq amp sr  :reverb-amount 0.15)

 (wait r) ))

 
(sprout(call_myexamp 40 .15 .10 500 2000 0.5 48000) "mytest.wav")
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20150429/d06992d3/attachment.html 


More information about the Cmdist mailing list