[PD] range of numbers
vanDongen/Gilcher
gml at xs4all.nl
Sat Aug 21 00:53:03 CEST 2004
On Friday 20 August 2004 18:18, Lazzaro N. Ciccolella wrote:
> yes,
>
> it is wery wery fast (sure faster than a lib)
> but how I can make it automaticaly ?
> how calculates the two numbers ?
>
> many thanks
> --
You want to map a range of 0.5 length f.i. starting at 0.1 to another range
starting at 0 or any other number.
You do that by
1)
subtract the smallest number (so that is mapped to zero)
2)
multiply by the desired-range/input-range (i.e.) biggest number - smallest
number)
3)if necessary add the new lower bound.
so 0.1-0.5 mapped to 20-500
goes like so:
- 0.1
* (480/0.4) = 1200
+ 20
G
More information about the Pd-list
mailing list