Logarithmic Multislider for Forbidden Planet FFT example

ziya's icon

Hi,

Is there any way to scale the multislider in Forbidden Planet example to a log based interface?

If you have noticed it is now linear, this means most of the low and mid frequencies are squeezed in the left hand side... i am looking for a way to have a multislider that behaves like a normal eq scale.(attachment)

the forbidden planet example can be found in /Max/Examples/fft-fun/forbidden-planet.maxpat

Thanks

Screen-Shot-2013-06-02-at-11.57.25.png
png
Wetterberg's icon

what you do is take a normal 0.-1. multislider, and feed it through this object:

[vexpr pow($f1, 3) * 12000.]

It'll do the conversion - the 12000 is the highest frequency, and the 3 is the degree of scaling, adjustable to taste. Add some value to this total to get your minimum frequency.

Peter McCulloch's icon

If you want to do this in decibels, dbtoa also handles lists, so if you want to specify volume in decibels, just change the range of multislider to something like -70 - 0. (I usually combine this with a vexpr that looks like this:

vexpr ($f1*($f1>-70))+(($f1

in order to zero out the lowest values.) You could set the fader range to be greater, but I don't think that going that much lower is really that useful here.

Then send this into a dbtoa.

Edit: misread this. You were looking for frequency.

ziya's icon

Thanks for the answers.

But as you know in this example a multislider with 512 sliders is being used and it then by listfunnel object it writes to a buffer. Which then is being used by pfft.

The multislider spits out a list of numbers (0[index], 0.[which is gain 0 to 1]), when i tried WETTERBERG's vexpr it scales both values which causes massive overload. It needs to scale only the index so it goes up the spectrum logarithmically.

logmultislider.maxpat
Max Patch
ak's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You probably need something different from multislider. Below my naive version with multislider, with "variably resampled" x axis.

Peter Castine's icon

Changing the multislider isn't going to change the fact that FFT is inherently linear regarding frequency. Each bin of an FFT has a constant frequency width.

ziya's icon

thanks Andrzej.

This is exactly what i was looking for.