Scale formula clarification

Nov 20, 2011 at 11:52pm

Scale formula clarification

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?

#60136
Nov 22, 2011 at 2:40pm

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. –
#216503
Nov 22, 2011 at 2:52pm

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.

Attachments:
  1. ll.og.zip
#216504
Nov 22, 2011 at 3:25pm

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!

#216505
Nov 22, 2011 at 3:53pm

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

#216506

You must be logged in to reply to this topic.