[CM] Scheme, Outa, and reverb

James Hearon j_hearon at hotmail.com
Tue Apr 28 16:53:32 PDT 2015


Hi,
I'm getting myself confused about the following info below from the manual about outa and *reverb*.  If I'm understanding correctly then, *reverb* is not a reverberator and you still have to supply one, such as jc-rev, which I think I did below using with-sound.

But I'm stuck trying to figure out how to use a reverberator with a scheme process instead of with-sound.  I know I can include the the reverb-amount etc. on the "send" line in the process, but I can't seem to figure out how to to include the jc-reverberator with the process or define.

Do I include the reverberator in the definstrument perhaps for calling it with a process?  I know using reverb from a scheme process is much easier if I use locsig instead of outa, but I was hoping I might understand if will work or not.

Thank You,
Jim
------
*reverb*
The reverb instrument has to send to the *reverb* output stream an 
appropriately scaled version of its main output, something like:
 
(outa i (* sample reverb-amount) *reverb*)
 
What clm does is, after with-sound processes the whole "note list" that 
is its body, it runs the reverb instrument that you supply over the 
reverb soundfile that it generated as part of running the body and then 
merges the output of that instrument run into the main soundfile generated.
--------
(if (not (provided? 'jcrev.scm))
      (load "jcrev.scm"))

(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 )
 (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/20150428/9aa7eb42/attachment.html 


More information about the Cmdist mailing list