[CM] Grace: Process in a Process

Uğur Güney ugurguney at gmail.com
Mon May 19 23:59:31 PDT 2008


# Hi,
# I'm trying to make a real-time drummer for using on performances
with my band, but stuck somewhere.
# I want to call a process in a process. The outer process will select
one of the inner processes. ie. "if a random variable is higher than
something than call this one, else call other one."
# There is a working example for this: "gestures.sal" but I can not
translate it to scheme language. The code below is what I have tried.
Using (one-note (next pat)) instead of (send "cs:i"...) did not
worked. What should I do?
# Have a nice day!
-ugur-

merdivenler.lisp:
(define-process (ritim n tempo)
  (run with
       pat = (make-cycle '(.2 .1 .2 .1 .1)) and
       rate = (/ (/ 60 tempo) 4)
       repeat n
       do
       (send "cs:i" 1 0 (next pat))
       ;(one-note (next pat))
       (wait rate)))

(sprout (ritim 10 120))

(define-process (one-note dur)
  (run repeat 1
       do
       (send "cs:i" 1 0 dur)))

(define-process (two-notes dur rate)
  (run repeat 2
       do
       (send "cs:i" 1 0 dur)
       (wait (/ rate 2))))


ritm.orc
sr=44100
ksmps=1
nchnls=1
0dbfs = 1.0

	instr 1	;untitled
idur init p3
aenv linseg 0, idur*.1, 1, idur*.9, 0

anoise noise 1, 0

out anoise*(aenv)^4
	endin



More information about the Cmdist mailing list