Inverse proportionality

alistair's icon

hi,
i need to transform a stream of data (numbers) i receive from the serial port in numbers that behave in the opposite way.
there, where i have great values (8000) i need 0 and when the great value decrease i need the small one to increase (7999=1)...
i don't know if my explanation is clear enough... i rekon it's called inverse proportionality and i suppose it's easy to do but i'm a stupid with numbers.
how can i do it with max math?
thank you very much
al

Brennon Bortz's icon

How about using a !- object?

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

jayrope's icon

This does what you want, too:

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

ComfortableInClouds's icon

[scale 0 8000 8000 0]

jayrope's icon

ha, thanx, i needed that one, too.

alistair's icon

thank you Brennon
!- 8000 was the stuff i was looking for
it was so simple...;-)

Emmanuel Jourdan's icon

On 29 oct. 08, at 23:18, jayrope wrote:

> ha, thanx, i needed that one, too.

add that one to the list: !- 8000

;-)

ej