[chuck-dev] FFT manual transform() fix

Julian Faust julian.faust at gmail.com
Sat Nov 10 13:31:49 EST 2012


I tried using the fft transform( float[] ) function to input frames manually, and found a thread from 2009 illustrating that this doesn't work - the manually input frame is ignored and the accumulated frame is used.

Boldly venturing into the ChucK source code (for the first time), I think I found the issue. The FFT_object::transform(Chuck_Array8 * frame) method sets m_buffer to the input array then calls FFT_object::transform(); but then m_buffer gets set to the accumulated array before the rfft.

By copying essentially all the code from transform() into transform(Chuck_Array8 * frame) but removing the line

    m_accum.get( m_buffer, m_window_size );

and not calling transform() I managed to compile a version that works as I expect it to - I'm not sure if there are other complications that make this a more difficult fix.

I hope to learn a bit more about ChucK's inner workings so please let me know if I'm misunderstanding anything above.

-Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-dev/attachments/20121110/9050fb7d/attachment.html>


More information about the chuck-dev mailing list