[Csnd] Real-time IFFT or additive synthesis from OSC data

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] Real-time IFFT or additive synthesis from OSC data

Julien Verneuil
Hello,

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 ?

Thank!

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Real-time IFFT or additive synthesis from OSC data

Nathan Holmes
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:
Hello,

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 ?

Thank!

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here