Hi,
I’m using PV_RecordBuf to retrieve data from FFT and send it to other app and I would like to be sure how is this data stored. Is it DC, mag[0], phase[0]… etc? Where could I find a more precise information about this?
Also, is this the best approach to retrieve FFT information from SC to other apps through OSC? (tried pvcollect, UnpackFFT, and other approaches, none of them did help me very much)
Here’s what I’m trying…
(
~fftsize = 256;
~hop = 1;
n = NetAddr("localhost", 12345);
x = { var in, chain,magphases;
in = SinOsc.ar(((MouseX.kr(1,255).round).poll*(SampleRate.ir/~fftsize)));
chain = FFT(LocalBuf(~fftsize,1), in,~hop);
/*magphases = UnpackFFT(chain, ~fftsize);*/
PV_RecordBuf(chain,c,0,1,1,~hop);
/*SendReply.ar(Impulse.ar(1),values:magphases);*/
/*chain = PackFFT(chain, 2048, magphases);*/
0.9 * Pan2.ar(IFFT(chain));
}.play(s);
~oscRoutine = Routine({ // Routine to send buffer data every 100ms (could be faster)
inf.do{arg i;
c.getToFloatArray(action: { arg array;
array = ["/myFFTdata"] ++ array; // adding an OSC address before the floats
/*array.postln;*/
n.sendMsg(*array) // * passes the array as arguments to the n.sendMsg method
});
(1/(s.sampleRate/~fftsize)).wait;
}
}).play()
)
Currently I’m checking the data in PD:
Thanks in advance for any clues/suggestions!