Forums > MaxMSP

Scale formula clarification

Nov 20 2011 | 11:52 pm

There are two posts discussing the formula for the scale object, but none really answer the question posted.

If the formula from the reference is:
y = b e-a log c ex log c

y = result
x = number to scale
a,b,c = the "three typed in arguments"
e = base of the natural log

My question:
There are 4 mandatory arguments, 5 with exponential scaling (which is why I’m interested in the formula). Given only three (a,b,c) – how does this work?

Also, what are the operators in the formula? I’m guessing:
y = b * (e-a) * log(c) * ln(x) * log(c)

Anyone dug in deep enough into their own scaling object?

Nov 22 2011 | 2:40 pm

I found something similar elsewhere, not the Max object, but it seemed like it did the same thing, no exponential element though. So, if scale has a b c d for low/high input/output, and v is the value to scale, the formula was:

c + (d-c)*((v-a)/(b-a))

I don’t know about the scaling exponent, whether it’s applied after all this, or is worked into the formula somehow. And I’m not sure this is even the right formula for [scale], but it works in the patch below:

-- Pasted Max Patch, click to expand. --

Nov 22 2011 | 2:52 pm

here are my scale-objects…
the basic expr here is:
expr (exp((($f1-$f2)/($f3-$f2)-1)*$f6)-1)/(exp(-$f6)-1)*($f4-$f5)+$f5
which works like scale but has an easy logarithmic scaling, where 0 is linear.

Nov 22 2011 | 3:25 pm

Fantastic, thanks Klaus! Too bad your ll.og abstractions don’t show up in a forum search – could have saved you the trouble…

Those are really great, and likely useful for my students as well.


Nov 22 2011 | 3:53 pm

thanks jeff,
well ll.og is just one of many objects, that are included in the ppooll distribution. there is more useful stuff in the whole package ;)

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

Forums > MaxMSP