Scale formula clarification

Jeff Thompson's icon

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

Where:
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?

seejayjames's icon

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))

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

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:

klaus filip's icon

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.

2946.ll.og.zip
zip
Jeff Thompson's icon

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.

Cheers!

klaus filip's icon

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 ;)
cheers