### reverse [scale] with exponential argument

I’m scaling an input stream of numbers with an exponential argument. Say the scale object looks like this:

[scale 0 100 0 200 1.05]

Later, I want to take an output number and find the original input number that created it.

So if there was no exponential argument, I would just switch the input and output low/high pairs so

50 -> [scale 0 100 0 200] -> 100 and

100 -> [scale 0 200 0 100] -> 50

With an exponential argument, for instance, I have:

50 -> [scale 0 100 0 200 1.05] -> 17 so how do I get from

17-> [scale 0 200 0 100 ????] -> 50

In patcher form:

<code>-- Pasted Max Patch, click to expand. --Copyallof the following text. Then, in Max, selectNew From Clipboard.----------begin_max5_patcher---------- 702.3oc2WE0aaBCD94To9evhm6hrMgP6dYZOteCSSUFx0DWAFjwjltp8eems gTZRSEsIP51K1v4ym+3693N3oKuXRPRwFnJf7UxOISl7DZYhyl0xjVCSBxEa RyDUNGCRKxyAkI3plEMvFiaAPT8HA1HxKy.xCRyJhp.uurPgtKEYjpTQlTsb 6NwafzhZka67Vqp5boJCLtSi0Z8tBkQIxA2I8cMFtsg4N8xDqY5TZqI4BmeE I2+kaB5D3hZSaj25aovjtBg0sZH03oB90XnHL+XjMtjvYSoje0EMUxe6PCiO k5L+mKuvNiSWc7jYpPQ9Aor1PvK5RhqEY0.YEnAhYkvfDcVFYobMPxsV.aFH 0PJzxkRE5O9Tm.5u85j9rAhzi+.jdXH2w2w2zg1mOuKsmTmjjA6AwSRlvySa wcoFpPFWXjEptJCVnEVblCqzlgmQ36lG6PZrCPZaeyvay7XI3ASfzpbHAIB7 kpmwvqInYQNXOalcxSs7W.7RgFAnAz2BJQCISOujLiGe5IY9fSxrnaNyjL7. 9jteIEa4WfPQLQwQFk127PLsG4g4uu7P3AxCrClG5mBm5KhPi1m8OOp3vYmd Q7rAWDaq695ZXD0x757cpl+F5Zj5Z2.p4Fc0Nyo1sZd1TZTvoP6FMLZWVyju O33ncOFUXXzvICih+L1u5nXK9PyV+C134n5fvNwuF1n4NCcPNpOnIdn0U+G1 K3jH.4QCh.rsMvGP.5cz8Kd69S8tiytvN7WUQsNsEdMeaAoyIt.pL3+QZ+1l NNE8RmVIWr.TuHSuPVYy9N15MRn8FVQ8AV7QGVg8AVrQGV79.qvwGVw8JKN9 pKdujWgmA8U+xjiuBa2i7..63RkM0yDkkqAcUSn8XBK7eeg94p11dQ968UeC zvZY6VB8lDZrhqAK2Vq8k12b87.bE2AhC+EuBkKh -----------end_max5_patcher-----------</code>

Have you looked at the reference for [scale]? The formula used in "exponential" scaling is documented, you just need to solve for the inverse. It’s just a bit of high school math.

If you can’t get your head around the math, there are people here who can help you out, but you should at least look at it first. (And I would need to be in less of a hurry than I am right now to work it out for you.)

Hi Peter,

Yes I read the reference, saw the formula and some older posts with similar requests. I was hoping for something as simple as an easy way to determine the inverse value for the exponential argument for [scale] that could be used to reverse an original value. I admit that I am a bit Math-challenged but I can slog my way through it or ask a friend. None of the posts I read provided a clear answer, most pointed to another way to solve the poster’s dilemma.

I think the answer is that you can’t do this with [scale] using an "inverse" scale obj parameter but need to re-architect with [expr] rather than [scale], using the reference formula and do something like??? like swap the low and high inputs and substitute log for exp I think. I’ll see if I can channel some long-forgotten high-school math…

Forums > MaxMSP