FFT Analysis of a sample stored in buffer and save the IFFT to an other buffer in order to play it with Playbuf

Hi there!

I have a sample stored in a buffer and want to perform some FFT operations on it. Is it possible to do FFT analysis to it, perform the operations and then save the IFFT directly to another buffer in order to then use it later in Playbuf?

Something like like this (doesnt work obviously):

b = Buffer.read(s, Platform.resourceDir +/+ “sounds/a11wlk01.wav”,numFrames:2048);

(
SynthDef(\help_PlayBuf, {| out = 0, bufnum = 0 |
var trig,in,chain;

chain = FFT(LocalBuf(2048), b);
chain = PV_MagAbove(chain, 0.1);
chain=IFFT(chain,winsize:2048);
trig = Impulse.kr(2.0);
Out.ar(out,
PlayBuf.ar(1, chain, BufRateScale.kr(chain), trig, 0, 0)
)
}).play(s, [\out, 0, \bufnum, b]);
)

thank you!

Hi,

See PV_RecordBuf and PV_BufRd, PV_PlayBuf from SC-plugins.

Hi!

thank you for your answer!
Well I had seen those before, but the problem I have with them (if I understood how they work correctly) is that they work in between the FFT and the IFFT. What I would like is to be able to have a sample stored in a buffer, perform some FFT operations whenever I want to it, and whenever this happens the IFFT to be stored on a separate buffer which I can use independently from the FFT and IFFT process. The reason for this is I want to use the IFFT sample into other Ugens that read from Buffers and not only the Playbuf or BufRd that the PV library offers… Would that be possible?

thanx again!

Ah, then I misunderstood your question.

The IFFT just returns an audio signal. So you can do something like this (which is totally independant from FFT processing)


processed = IFFT(…);
RecordBuf.ar(processed, buf, …);

or out to a bus and record with a separate synth from the bus.

Thank you for your answer!