Stereo sig to 6 channels using PanX.ar()

Hi everyone,
I would like to kindly ask you, if you know an alternative way to achive this result, without duplicating the PanX.

I have a Stereo signal and I need to spatialize it like that:

// 0 -> [0, 1] -> couple of speakers 1 (inside a phisical object)
// 0.2 -> [1, 2] -> …
// 0.4 -> [2, 3] -> couple of speakers 2 (inside another phisical object)
// 0.6 -> [3, 4] -> …
// 0.8 -> [4, 5] -> couple of speakers 3 (inside another phisical object)

// use a “trigger” to choose the value associated to a couple of speakers
posMod = TChoose.kr(trig, [0, 0.4, 0.8]);
sig = PanX.ar(6, sig[0], posMod, 2) + PanX.ar(6, sig[1], (posMod+0.2).clip(0,1), 2);

Suggestions are welcomed!
Thank you very much in advance

Not at my computer but I guess like this:

sig = PanX.ar(6, sig, (posMod + [0, 0.2]).clip(0, 1), 2)

hjh

Thank you @jamshark70,
unfortunately I receive this message, I have to look at it calmly, as it is a new thing for me to use Ndefs and PanX .

WARNING: Synth output should be a flat array.
[ [ a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen ], [ a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen ] ]
Flattened to: [ a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen, a BinaryOpUGen ]
See NodeProxy helpfile:routing

I guess the answer is to look at the:

NodeProxy helpfile:routing

Ah ok… Well, there’s one detail in your original that I overlooked.

PanX(left) + PanX(right)

And the result of my expression is

[PanX(left), PanX(right)]

So… how would you go from [a, b] --> a + b?

.sum

So PanX.ar(same as I wrote before).sum… again, untested, but the “sum” does correspond logically to your original.

hjh

1 Like