[CM] csound score, 2 instruments

Fergal Dowling fd106@york.ac.uk
Tue, 20 Jul 2004 18:03:29 +0100


Hi,
I wish to write a csound score for that uses two instruments, i1 and 
i2, and control their respective start times using independent time 
varying envelopes. To achieve this, I now output two separate .sco 
files, one for each instrument, and then copy and paste one into the 
other. How can I append the out the second files to the first?

Thanks in advance.
Fergal Dowling.

fd106@york.ac.uk
http://www-users.york.ac.uk/~fd106/


;;; Define new class object for csound instrument 1.
(defobject i1 (i)
   (amp)
  (:parameters time dur amp))

;;; Define new class object for csound instrument 2.
(defobject i2 (i)
   (amp)
  (:parameters time dur amp))

;;; Define first start time envelope
(define start-env '(0 .9 1 .1))

;;; Define second start time envelope
(define start-env2 '(0 0.1 1 0.9))

;;; Define process
(define (my-first-process start-env end)
(let ((rhy 1))
     (process for beg from 0 by rhy
     until (> (now) end)
     for nstart = (interpl (/ (now) end) start-env)
            output (new i1 :time (now)
                        :dur .5
                        :amp 1)
	   wait nstart)))

;;; Define second process
(define (my-second-process start-env2 end)
(let ((rhy 1))
     (process for beg from 0 by rhy
     until (> (now) end)
     for nstart = (interpl (/ (now) end) start-env2)
            output (new i2 :time (now)
                        :dur .5
                        :amp 1)
	   wait nstart)))
	
;;; Render first instrument
(events (my-first-process start-env 60)
  "ins1.sco" 0)

;;; Render second instrument
(events (my-second-process start-env2 60)
  "ins2.sco" 0)