[PD] range of numbers

Lazzaro N. Ciccolella ciccolix at tiscalinet.it
Fri Aug 20 18:55:47 CEST 2004


On Fri, Aug 20, 2004 at 06:23:48PM +0200, IOhannes m zmoelnig wrote:
> Lazzaro N. Ciccolella wrote:
> 
> >I would want to convert a stream in the range 
> >from 0 (0.01 0.02 0.03 .. 0.99) to 1  (the x coords of a xv window)
> >in a stream of numbers from 0 to 127.
> 
> how about [* 127] ?
> maths can be awesome...
>
Thanks but
(apologize if I have too much simplified the question)
what succeeds if I must convert one portion of that range ?
example 
I would want to convert 
the range 0.20 - 0.60 
in the range 0 - 127

in other word:

0.20 must become 0
and
0.60 must become 127

(I am making a patch that transforms whichever thing inside a pidip_canvas 
in one slider 0-127)

I have already made the subpatch (with the maths object :)) that make this trasformation
but 
the patch becomes more and more large and I asked if were a pd object that let me to save cpu.

many thanks
--
Lazzaro




More information about the Pd-list mailing list