Accessing lists at signal rate

Daniel Rothmann's icon

Hello maxers!

I'm working on a fft patch in which I need to access a value from a list for each fft bin index. Having trouble getting it working.

So far I've tried using snapshot~ with zl.lookup (which i could not get to work reliably) and I've tried storing the list values in a buffer~ and accessing it via lookup~ but the list values get clipped to above/below 1 and -1 in the buffer (the real values will range from -70 to 0).

Does anyone know a good way to reliably look up values in a list at signal rate? Or should I try to somehow scale down my list range into the buffer range and scale back up when accessing?

Thanks!

Roman Thilenius's icon

if your -70 gets clipped when written into a buffer there must be something seriously wrong in your patch.

Christopher Dobrian's icon

There's no inherent limit to the range of a buffer~.

The way to look up values at signal rate is with buffer~. (That's precisely what it's made for.)

You can use the right (sync) outlet of fftin~ to index the buffer one value per FFT bin, with index~. (That's precisely what it's made for.)

See the attached file for an example. Save it in your file search path, then try it out with this patch. (The patch uses multislider to set the values in the buffer~.)

Max Patch
Copy patch and select New From Clipboard in Max.

fftindexing.maxpat
Max Patch
Daniel Rothmann's icon

Thanks so much Christopher, this was exactly what I was looking for.

Turns out I had only tried viewing the values from my multislider in the buffer "preview" window - which would show only the -1.-1. range. When actually checking with index~ it's working just fine.

Don't I feel silly! Thanks for the insight.