### 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?

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. --Copyallof the following text. Then, in Max, selectNew From Clipboard.----------begin_max5_patcher---------- 944.3oc0Z9saZCCEF+ZpzdGhh5EsazN6i+Cgc2dNlplBfoMSPBhDzXqZu6y1 gfRao0tRA6S6Ewfiaxm+4OeN1I73mtXT5rp8p5zjuk7ijQidTWyHaclZF0Uw nz046muJu11vzY6ZZpJSGe3bk6VWTtR0XOIsq1hE11VM6W2vx521pcMunws0 07mMpVkjNKu79zj65N+l7l4OTTd+O2pl2z1DFI6Vx3D6AfzcL4N6+w+9zElR cwXu6UKWUoU2QktrproLesUPoeeaQ9pimZV01EpsyqVUssUKTysmb7.0nC+o i73EdyVUsprIuonprWWUz1UmJ5eadxcnGSg9cfk4yUO49Zprt3usUx0WpWa. PSi7lzw9LRzIOo4nXpcnfEngB2zEbQWfMwJ+I3jt.S1itRjQWlK5xonlt71P GH06xcQWl.0zkIIH16JbFYXJtiLLUNvd20p5576UG4RiZu8dkRIj2MygSwbp ybcltvXcXCeX9owK7F30Qz.pkkRy.jdt0sSD5j4YmGjJFFfRbF.VFQfxDgCn zgwhBScRTBXmqIhAQOLoOHDcf.pyU+OTngACMZFvzMfykJQI1YpSj3LcSqt. BGiIyAmKUBxPMcAIoOdQ1JQA2qUBvMdIDL6dc9H.nRTiWJSNzt2R0u0n4kIk zhZgUPCB3gAK2j2OwpVTIkefejUTQJx1hIjYcdG9x4w40jLKY4fX6nbe3m+1 twcH6MQkrc2M.j0aARAyA5FJLzYphR1hAdpJfFpdv+Qag6YMIgZ+lsIWtjk7 kjqtbIO4FyWt9yWo+h3lKWRu9q5OA1Oc8617JNEloAZSNcVSdVWgjn+S9wMW BAMFTQ695yxN6oRpmmuRookdOe2lHLEjae29P4In4z.YCOfp1BplRfwEhp7I Y3wWw4HducRzvIdFGwaRimhrWZUb7SCaze.YA+cu3j1KR5phxW7ylvdUMm3Y jttZ214cRp6GDQROLsPU2TTZ2yeuVY1bZ+V8PwhEJaCN1gWWrXSUQYyAk7VF .+EmzKwgXsQij3X9HtLDqMySQMFhi6i3jHValmOZLDmvGwwQr1fHMpBdEGgg XwAwQbfWhy7d9wq3HHVblW+LdEWjRdQ8ZXMRyVIdIt3DD94toWQbwI6E30pf YwYwbfW48M3kGdsI7UarvqMouZCBu1X9pMZv0lWSToQJykuXK7Ri5UpAZbBv Q8aUlwI0.0q.bTZ7DG0KwE9vu9CtvGFQ5s1Be32Lu0V3SaQYAZ1foBcw+wS3 LeM -----------end_max5_patcher-----------

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:

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!

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

Forums > MaxMSP