View Full Version : Threads in IPlug
Stu Kennedy
06-02-2009, 03:06 AM
I'm wanting to do a real-time FFT (using fft.h from the WDL library) ... I'm running it in the ProcessDoubleReplacing() callback, but it crashes the plugin ... is this because it's taking too long to complete? Do I need to create a separate worker thread for the FFT? Can I do that in IPlug or WDL?
schwa
06-02-2009, 04:59 AM
That is very likely because wdl_fft is expecting different sized data. Be sure to set WDL_FFT_REALSIZE=4 or 8 in your project preprocessor defines (must be projectwide so both sides see the same define). Set it to 4 if you are passing floats, 8 if you are passing doubles.
Also be sure you are calling wdl_fft_init() at some point before trying to calculate anything.
Stu Kennedy
06-03-2009, 03:01 AM
thanks Schwa ... you're a star!
Do I have to call wdl_fft_init() every time before I run WDL_fft()?
Or just once for the project?
Stu
schwa
06-03-2009, 05:17 AM
Just once, it initializes some static tables.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.