COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 06-02-2009, 03:06 AM   #1
Stu Kennedy
Human being with feelings
 
Join Date: Mar 2009
Location: Glasgow UK
Posts: 83
Default Threads in IPlug

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?
Stu Kennedy is offline   Reply With Quote
Old 06-02-2009, 04:59 AM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

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.
schwa is offline   Reply With Quote
Old 06-03-2009, 03:01 AM   #3
Stu Kennedy
Human being with feelings
 
Join Date: Mar 2009
Location: Glasgow UK
Posts: 83
Default

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

Last edited by Stu Kennedy; 06-03-2009 at 04:03 AM.
Stu Kennedy is offline   Reply With Quote
Old 06-03-2009, 05:17 AM   #4
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

Just once, it initializes some static tables.
schwa is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.