hey, this is loosely connected to this thread. I would like to generalize the following function for n-channels. Does somebody has an idea how to go about that? thanks.
(
var channelMask = { |trig, numChannels, channelMask, centerMask|
var rate = if(trig.rate == \audio, \ar, \kr);
var channelsArray = Select.kr(numChannels, [
// 2-channels
[
Dser([-1], channelMask),
Dser([1], channelMask),
Dser([0], centerMask)
],
// 3-channels
[
Dser([-0.33], channelMask),
Dser([0.33], channelMask),
Dser([1], channelMask),
Dser([0], centerMask)
],
// 4-channels
[
Dser([-0.25], channelMask),
Dser([0.25], channelMask),
Dser([0.75], channelMask),
Dser([-0.75], channelMask),
Dser([0], centerMask)
],
// 8-channels
[
Dser([-0.12], channelMask),
Dser([0.12], channelMask),
Dser([0.37], channelMask),
Dser([0.63], channelMask),
Dser([0.88], channelMask),
Dser([-0.88], channelMask),
Dser([-0.63], channelMask),
Dser([-0.37], channelMask),
Dser([0], centerMask)
]
]);
Demand.perform(rate, trig, 0, Dseq(channelsArray, inf)).lag(0.001);
};
)