At 11:23 AM 10/7/99 , Ross Bencina wrote:
>Hi all, a simple question:
>
>Is there a way to have a single effect instrument definition that is
>instantiated multiple times and used with different routings. For example:
>
>Out = (Piano->Reverb) + (Drums->Reverb->Flanger)
>
>where there are two instances of the Reverb instrument, one taking input
>from all instances of Piano, one taking input from all instances of Drums.
>if so, how do you control their parameters from the score?
I had a similar problem recently. I solved for instance like that:
instr low_shelving(chan) {
ivar pi;
ksig kk, rgain, freq, gain;
ksig a0, a1, a2, b0, b1, b2;
ksig first, ki, curr_gain, curr_freq;
imports ivar ls_freq_init, ls_gain_init;
imports ksig ls_freq, ls_gain, ls_index;
asig ls_out[inchannels], this_chan[inchannels];
[...]
ls_out[chan] = iir(input[chan], gain*a0/b0, b1/b0, gain*a1/b0, b2/b0,
gain*a2/b0);
this_chan[chan] = input[chan];
output(this_chan + ls_out);
}
And in the global block, for two channels:
send(low_shelving; 0; bus1);
send(low_shelving; 1; bus2);
In my example I output the two channels on a two-channels bus, since I have
a pipeline of two-channel stages. And so on...
In this way you have two instances working on a single channel. After a brief
consultation with Eric it seems that the only way to control that is to use an
index and a value. In my case if I want to change the ls frequency gain for
the first channel I send a
time_T control ls_freq_index 0
time_T control ls_freq_gain 3
and so on. The only drawback I see is that I cannot change two values in the
same k-cycle.
Kind regards,
Giorgio
__________________________________________________________________
Giorgio ZOIA
Integrated Systems Laboratory - DE/LSI - EPFL
CH-1015 Lausanne - SWITZERLAND
Phone: + 41 21 693 69 79 E-mail: Giorgio.Zoia@epfl.ch
Fax: +41 21 693 46 63
__________________________________________________________________
This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 11:46:35 EST