robertesler / Pd4P3

A real-time audio synthesis library for Processing 3. Pd4P3 implements Pure Data's signal processing objects via Pd++ native code. Pd4P3 stands for "Pd++ for Processing 3".
GNU Lesser General Public License v2.1
7 stars 1 forks source link

FFT indeterminate behavior on MacOS #12

Closed robertesler closed 1 month ago

robertesler commented 1 month ago

Perhaps this bug has been there for a while, but since updating to Sonoma on an Intel chip I've noticed distortion on most of the examples that use FFT in some manner. I plan to test on M1 chips as soon as I have an opportunity.

This has not been noticeable on Windows or Linux (Android too), but more testing is needed. I'm guess there is something going on with the C++ backend but have no real idea where this is coming from at the moment.

Behavior: Examples that use FFT may experience a short burst of distortion at the very beginning of their audio cycle. Usually, this distortion is gone after the first 1-2 FFT windows, but not entirely sure if that is the case yet. Does not happen consistently.

Cause: FFT or IFFT (e.g the rFFT and rIFFT classes). But why is still unknown

Current Solution: You can zero out this buffer, or not write it to audio loop. You can add a fade in, or live with it.

urbanstew commented 1 month ago

The issue may be due to the array in rIFFT not being initialized to zero, this may have already been fixed. https://bitbucket.org/resler/pd/issues/3/real-ifft-array-not-initialized-to-zero Will keep testing new build(s) to see if that fixes this issue.

robertesler commented 1 month ago

Yes, this seemed to have fixed the issue. Closing for now. Can reopen if necessary.