converting a range of numbers
let's say an object gives me two numbers - a range between 150 and 275. these two numbers are actually a y coordinate from a tracking object, and my head was at the bottom of the screen.
i would like that to be sent to something like a dial. but a dial needs to start at 0. so how would you begin to convert this into something useable?
(scale) is something i have used
I think this:
(scale 150 275 0 100)
you can also add a decimal point.
(scale 150. 275. 0. 100.)
use a (flonum) to read decimal press 'f' instead of 'i' on the main screen
if you do not want a linear scale.
you can break it up into sections with (split)
like this
(split 150 210) > (scale 150 210 10 30)
(split 210 275) > (scale 210 275 30 100)
you can apply a different scale range to each split you make, you can split as much as you like.
this will create response curves. instead of a straight linear line as it were.
you can control the scaling exactly as you desire.
But it takes up ram of course.
place them all inside (patcher) to hide them away
makes life easier.
awesome - this looks like it did the trick even with just testing it out using a line object. thank you !
Or, if you're dealing with ints, you could simply pass your values through a a [- 150] object and set up the dial with @size 126.