max4.live

a better search for max devices
PFFT Latency Calculator and M4L Delay Measurement screenshot

PFFT Latency Calculator and M4L Delay Measurement

by fakedubz

(Disclaimer: This patch is for educational purposes and won...

View on maxforlive.com

Type
Audio Effect
Author
fakedubz
Version
1.2
License
None
Live version
11.3.11
Max version
8.1.5
Downloads
223
Updated
2023-12-23

Description

(Disclaimer: This patch is for educational purposes and won't actually work as an effect. So, if you aren't working on a spectral device yourself, this is probably pretty useless to you.)

PFFT is a genuinely useful module for spectral effects, but unfortunately I haven't found a single device or explanation that shows how to set the latency correctly.

Probably because even the official documentation on the matter is not entirely correct. (yikes)

Working latency compensation is crucial for correct timing, as well as for avoiding phase cancellation when using a dry/wet knob.

This patch includes a patch calculating the correct latency of a PFFT object based on the FFT size and overlap, returning the latency to the patcher so that Ableton's Delay Compensation can work correctly. This also functions correctly upon loading the patcher. Feel free to copy-paste this patcher into your own devices.

A test setup to measure the sample-accurate latency of a patcher/plugin is included as well, so you can verify that the latency is indeed calculated correctly. Or test other modules and plugins etc. as well. The test PFFT is also an example of how to change the FFT size dynamically.

This whole topic gave me a real headache, and I'm really glad I finally figured out the math behind it. So, I hope this helps someone having the same troubles. If something still isn't working or something is unclear, comment below or send me an email, and I'll try my best to help out. XD

Update 1.1:

- Added an example on how to implement a constant Volume Dry/Wet with proper delay compensation on the dry channel to avoid phasing.

- Added some arrows to make explanations clearer

- Added some more explanations and structure

- Just made it look better I guess

Update 1.2:

- Latency Calculation is working correctly inside MaxMSP as well when using different Signal Vectors.

← Back to search