Thanks! ]]>

The linear part is easy:

- Subtract the low input value from the number, then divide the result by the difference between high input value and low input value. This gives you a number between 0 and 1.

- Then multiply this again with the difference between low output and high output value, and finally add the low output value.

As an expression, this would look like this:

expr “(($f1-$f2)/($f3-$f2)) * ($f5-$f4) + $f4″

$f1 being your number input, $f1 the low input value, $f2 the high input value, $f3 the low output value, $f4 the high output value.

This still ignores the exponential part, but I don’t think this should be too hard to figure out as well.

EDIT:

eh, I’m silly. Should have looked into the documentation of [scale] first where the formula is written down. So that’s what you should do as well!

]]>y = b*e^(-a*log(c)) * e^(x*log(c))

it says “a,b and c are the three typed-in arguments”.

So c is the exponential factor and e is the base of the natural logarithm.

But what’s a and b ??

Thanks a lot guys!

]]>I managed to do something similar to [scale 0 255 -1. 1.] with the following expresion

[expr (in[0]/255-0.5)*2]

but I don’t have a clue how to do [scale 0 255 1. -1.]

Does anyone know? I’m not good at maths either

]]>I did the first part for the x coordinate where 0 becomes -1. and 640 becomes 1. But for the y value, 0 is 1. and 480 is -1.

So I would need an expresion for jit.expr to turn a (-1. 1) matrix the other way around (1. -1.)

– Pasted Max Patch, click to expand. –

]]>
[jit.op @op * @val -1.]

]]>Thank you so much, Jesse!!

]]>