[CM] csound score, 2 instruments

Anders Vinjar andersvi@extern.uio.no
Wed, 21 Jul 2004 12:18:15 +0200


>>> "FD" == Fergal Dowling <fd106@york.ac.uk> writes:

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

Passing a list of the processes you want to output to #'events
will merge them together in the same destination.

(events (list  #&seqone #&seqtwo) "together.sco" 0)

(events (list (my-first-process start-env 60)
	      (my-second-process start-env2 60))
  "ins3.sco" 0)

; Common Music 2.5.0 output on 21 Jul 2004, 12:12:19
i1 0 0.5 1
i2 0 0.5 1
i2 0.1 0.5 1
i2 0.20133334 0.5 1
i2 0.30401778 0.5 1
i2 0.40807134 0.5 1
i2 0.5135123 0.5 1
i2 0.6203591 0.5 1
i2 0.7286306 0.5 1
i2 0.83834565 0.5 1
i1 0.9 0.5 1
i2 0.94952357 0.5 1
i2 1.0621839 0.5 1
i2 1.1763463 0.5 1
...

If you actually need to append them for some reason you can
output the resulting subobjects to temporary seq's before
appending them together in a separate seq:

(events (my-first-process start-env 60)
	(new seq :name 'seqone) 0)

(events (my-second-process start-env2 60)
	      (new seq :name 'seqtwo) 0)

(new seq :name 'together)

(setf (subobjects #&together) (append (subobjects #&seqone) (subobjects #&seqtwo)))

(events #&together "together.sco" 0)

; Common Music 2.5.0 output on 21 Jul 2004, 12:15:15
i1 0 0.5 1
i1 0.9 0.5 1
i1 1.7879999 0.5 1
i1 2.6641598 0.5 1
i1 3.5286376 0.5 1
i1 4.381589 0.5 1
i1 5.223168 0.5 1
i1 6.0535254 0.5 1
...