Forums > MaxMSP

scaling control signal to modulate filter cuttoff frequency


DJF
April 29, 2012 | 2:22 pm

I am trying to scale a -1 to 1 control signal to modulate a filters cutoff frequency. I am trying to do this using the bickered filter – which ranges from 0.0001 to 22000 on a logarithmic scale. The way I have started to do this is by scaling the control signal to output values between 0 127, and then routed this to a dial. Because the filter is logarithmic, I can’t really scaled [0 127 0.0001 22000.] because it produces a weird effect when changing values. Could somebody help me?


April 29, 2012 | 3:00 pm

Why scale it down to 0-127? You’re throwing a way a toooon of resolution by doing that. (unless you’re talking about 0. to 127., but that’s weird too).

In terms of the actual scaling/remapping/log stuff, I find this patch infinitely useful:

– Pasted Max Patch, click to expand. –

April 29, 2012 | 5:27 pm

Without seeing your patch I’m not sure that this addresses your issue:

– Pasted Max Patch, click to expand. –

April 30, 2012 | 12:45 am

if you want to log map the range 0.0001 to 22000, you need to work it out as ratios, which would be 1:1 to 1:220000000.
to divide that into 127 equal geometric parts, you get the 127th root of 220000000, which happens to be 1.163290977….
this is your base
then you simply have [expr pow(1.163290977,$f1)], but divide the result by 10000 to rescale from 1-220000000 to 0.0001 to 22000
that is how to map 0-127 to that range logarithmically


Viewing 4 posts - 1 through 4 (of 4 total)