[CM] Scheme, outa and reverb

2015-04-29 Thread James Hearon

  Scheme, Outa, and reverb  



 James Hearon   


4/28/15 



 To:  
cmdist@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")
  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Scheme, Outa, and reverb

2015-04-29 Thread anders . vinjar
Hi Jim.

J> But I'm stuck trying to figure out how to use a reverberator with
J> a scheme process instead of with-sound.

When using sprout, options you would pass to with-sound may be added at
the end of the call, ie:

 (sprout (call_myexamp 40 .15 .10 500 2000 0.5 48000) "mytest.wav" :reverb 
jc-reverb)

Cheers,

-anders

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist