[CM] Multipart in a "process"

Heinrich Taube taube at uiuc.edu
Sat May 10 05:36:34 PDT 2008


> Hi
> I try to generate multipart music (with different rhythmic values)  
> within the same 'process', because all parts have to get their  
> values serially from the same set.

hello there are a number of ways to express this. here is one that  
uses a process:

(defun cellular ()
  (process repeat 10
	   for key1 = 40
	   for key2 = 60
	   for dur1 = .2
	   for dur2 = .4
	   for amp1 = .7
	   for amp2 = .3
	   for beg1 = (random 1.0)
	   for beg2 = (random 1.0)
	   sprout (new midi :time (+ (now) beg1) :duration dur2
		       :keynum key1 :amplitude amp1)

	   sprout (new midi :time (+ (now) beg2) :duration dur2
		       :keynum key2 :amplitude amp1)

	   wait (max beg1 beg2)
	   ))

(events (cellular ) "foo.mid")


another way would be to write a LOOP that simply collects events and  
then sprout that list:


(defun cellular()
  (loop ...
        collect (new midi :time beg1 ...)
        collect (new midi :time beg2 ...)
  ))

(events (cellular ) "foo.mid")


best ,rick













More information about the Cmdist mailing list