| The strategy would be to create a mixer. There are several ways of doing this -- zak channels, channel opcodes, mixer opcodes, global variables, and so on. Then, you create a user-defined opcode that instruments call for output. Here's an example using the mixer opcodes. In this case, the instrument calls the AssignSend opcode to set up levels on various output busses. The SendOut opcode then actually sends the output signal to these busses with the levels set by the AssignSend opcode.
For your purposes, you could set up an output buss that goes to fout, and another output buss that goes to outs. In the same way, you can route signals to different channels of the output.
The CsoundAC.csd file in the examples directory has a complete mixer setup. CsoundAC.csd isn't doing exactly what you are calling for, since it ends up mixing all the output busses back down to outs, but it could certainly be adapted to do it.
opcode AssignSend, 0, iiiii
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
insno,ic,il,ir,im xin
inum = floor(insno)
;print inum, ic, il, ir, im
MixerSetLevel inum, 200, ic
;MixerSetLevel inum, 201, il
MixerSetLevel inum, 210, ir
MixerSetLevel inum, 220, im
endop
opcode SendOut, 0, iaa
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
insno, aleft, aright xin
inum = floor(insno)
MixerSend aleft, inum, 200, 0
MixerSend aright, inum, 200, 1
MixerSend aleft, inum, 210, 0
MixerSend aright, inum, 210, 1
MixerSend aleft, inum, 220, 0
MixerSend aright, inum, 220, 1
;print inum
endop
-----Original Message-----
>From: Charles Gran
>Sent: May 11, 2008 2:58 PM
>To: csound@lists.bath.ac.uk
>Subject: [Csnd] Re: Multi-channel file vs. set of stereo files.
>
>Related to this question (below), is there a better way to send each
>instrument out to a different asio channel for "live" performance that
>could work with the fout/soundout as suggested?. What I've been doing
>is controlling these instruments using the sequencer (Sonar) and now I
>am taking those tracks for further processing.
>
>I'm wondering what a strategy would be for creating an orchestra that
>could be used in real-time and then maybe had some switch (a line of
>code or something) when you wanted to record a performance in multiple
>stereo tracks, one per instrument.
>
>On Sat, May 10, 2008 at 7:56 PM, Charles Gran wrote:
>> I'm working on a piece that has 7 stereo instruments. I want to
>> continue to work on the audio in a DAW (I'm using Sonar4 on XP). What
>> I've been doing is sending each instrument to it's own out. So
>> instrument 7 ends:
>>
>> outc ganull, ganull, ganull, ganull, ganull, ganull, ganull, ganull,
>> ganull, ganull, ganull, ganull, a1, a1
>>
>> and what I am getting is a 14 channel wave file. This is fine, when I
>> import this into Sonar I get 16 mono files. But it would be nice if I
>> could get to 8 stereo files more easily. For now I can export them
>> from Sonar and create the files I need, but I was wondering if csound
>> could make the stereo files for me, rather than the single
>> multi-channel file.
>>
>> Charles
>> --
>> http://www.campdeadly.com
>>
>
>
>
>--
>http://www.campdeadly.com
>
>
>Send bugs reports to this list.
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
|