FFT doesnâ€™t work that way. You can do what you want, but I think you need to do it with multiplying the magnitudes in left and right channel versions of the FFT. So, in the code below I have taken the FFT, then copied the buffer so we have a left and right channel. To pan each bin to a different location, I come up with a magnitude value for each bin in each channel. Because an FFT has both mag and phase, I need to make buffers that have both mag and phase values, so each buffer is [mag0, phase0, mag1, phase1â€¦etc] (I am ignoring the first two values of the FFT because they donâ€™t actually matter in this situation). Then once I have the mags for left and right channels I use PV_MagMul to multiply that buffer by the FFT channels. It doesnâ€™t sound like much, but each time you run it, it should sound a little different.

Sam

```
//create two buffers
//each buffer needs to have 1024 values that go mag0, phase0, mag1, phase1, etc
(
~pan = Array.fill(512, {rrand(0,1.0)}); //random panning for each bin
~magsL = [(1-~pan).sqrt]; //left volumes for each bin
~magsL = ~magsL.add(Array.fill(512, {0})).flop.flatten; //add phases of 0 and fold them into the
~magsR = [~pan.sqrt].add(Array.fill(512, {0})).flop.flatten; //right values done in one line instead of two
//load them into Buffers
~magBufL = Buffer.loadCollection(s, ~magsL);
~magBufR = Buffer.loadCollection(s, ~magsR);
)
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
(
{
var in, chainL, chainR, buf = c;
var localB = LocalBuf(1024);
in = PlayBuf.ar(1, buf, BufRateScale.kr(buf), loop: 1);
chainL = FFT(LocalBuf(1024), in);
chainR = PV_Copy(chainL, localB); //duplicate the FFT
chainL = PV_MagMul(chainL, ~magBufL); //multiply the left fft by the left mags
chainR = PV_MagMul(chainR, ~magBufR); //multiply the right fft by the right mags
IFFT([chainL, chainR]) //IFFT in "stereo"
}.play
)
//with pan locations of just left or right, we can actually hear it working
(
~pan = Array.fill(512, {[0,1].choose});
~magsL = [(1-~pan).sqrt].add(Array.fill(512, {0})).flop.flatten;
~magsR = [~pan.sqrt].add(Array.fill(512, {0})).flop.flatten;
~magBufL = Buffer.loadCollection(s, ~magsL);
~magBufR = Buffer.loadCollection(s, ~magsR);
)
//with mags of 0, we should hear nothing.
(
~magBufL = Buffer.loadCollection(s, Array.fill(1024, 0));
~magBufR = Buffer.loadCollection(s, Array.fill(1024, 0));
)
```