Re: [Csnd] Real-time IFFT or additive synthesis from OSC data
Let me start with a disclaimer that I haven't used these opcodes extensively myself. Nonetheless, I think you will want pol2rect (to convert magnitude and phase to an interleaved real-imaginary array), then rifft to do the actual transform, and then lastly the shiftout opcode to put the final array values into an audio signal. The documentation for rifft and rfft have some examples of how to set it all up. See here: http://www.csounds.com/manual/html/rfft.html
Note that, assuming rifft expects an array in the same format that rfft produces, the first two entries of the array you pass to rifft should represent DC (0 Hz) and Nyquist (sr/2). Specifically just the real coefficients, I think, since I don't believe real FFT/IFFT transforms typically include imaginary coefficients for DC or Nyquist---although the opcode documentation could stand to be a little clearer on that point.
So anyhow, if the OSC data you're receiving has the Nyquist bin at the last index, for example, you'll need to reassign that one "by hand".
I don't know anything about the performance impact, I'm afraid.
On Wed, Aug 23, 2017 at 2:41 PM, Julien Verneuil <[hidden email]> wrote:
is it possible to do real-time IFFT or additive synthesis from received OSC data with cSound ?
My data is frequencies/bins index along with amplitude values for each channels and phase value.
Which opcode would be useful to do that, what would be the performances impact ?