how to conver numbers Help.

balam's picture

Hi, I pulling my hair tring to convert values ( 0.0 and 0.9) to 0 360

is there any thing similar to map in quartzcomposer

thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: how to conver numbers Help.

ahh you must be a processing guy if your asking for a map function. that was my first question when i started using qc as well. its surprisingly simple. i got all kinds of cool math expression trick answers but psonice's answer resonated the most with me and that was to use interpolate. right click on the interpolation patch and set it to external time. then what ever you feed into the patch time input will get scaled to your start and end ranges.

i found i do this so much i made my own function that works a little better if you know the ranges your dealing with.

http://kineme.net/composition/dust/JavaScriptMapFunctionInterpolatableCu...

the only caveat here is that you need to know the original range your values are in to map them properly. if you don't really have any clue what your input ranges are then the stock interpolation patch would be a better fit.

harrisonpault's picture
Re: how to conver numbers Help.

Mathematical Expression patch will do that

e.g. a/.9 * 360

Or, you might want to consider Interpolation patch to, with external patch time.

balam's picture
Re: how to conver numbers Help.

Dust, your solutions works great.

you are rite I am cousin to processing I use arduinos. thanks

balam's picture
Re: how to conver numbers Help.

Harrisonpault your soluton also works great....

balam's picture
Re: how to conver numbers Help.

this solutions are great, now my next journey is how to smooth those values ( the smooth patch) works but makes everything go over values