We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
zmap Max/Msp equivalent (Read 1082 times)
zmap Max/Msp equivalent
Feb 25th, 2007, 9:55pm
 
Hello dear developers, it would be nice to implement an extra function for scaling the variables, i mean the same functionality as it has the "zmap" max/msp's object. Its my personal favourite.. and i think many users could consider it as useful.

sending an example:

Code:


void zmap(float input, float inMin, float inMax, float outMin, float outMax){

out = (input-inMin)/(inMax-inMin)*(outMax-outMin)+outMin;

}



..simple but effective


Regards, kof
Re: zmap Max/Msp equivalent
Reply #1 - Feb 26th, 2007, 2:46pm
 
is map() what you're looking for?

the reference here on the site hasn't been updated unfortunately, but the latest release will have its description.
Re: zmap Max/Msp equivalent
Reply #2 - Feb 26th, 2007, 4:27pm
 
Great.. yes, that's exactly it.. sorry for my retardation.

thanks, kof
Page Index Toggle Pages: 1