reverse a stream of numbers

Mr. Tunes's icon

if i am using something like my mouse position to control the pitch of an oscillator, how do i reverse the numbers? For example if moving my mouse down is making the pitch go up, how do i make it pitch down instead?

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Use [screensize] to get your screen dimensions, [mousestate] to get the coordinates of your mouse, and [!-] (using the screen height) to flip the mouse y coordinate.

commathe's icon

You could also use a [scale] object to map things in reverse.

Mr. Tunes's icon

scale seemed to work great. thank you