[PD] Range object

Chad Wood chadwickw at mail.utexas.edu
Tue Mar 18 20:56:09 CET 2003


Yo,
I don't know of an object out there that does this specifically, but there
might be one.  But you could make a simple subpatch that does this.  I'm
assuming you want a linear mapping of input to output...
the general equation is (I think!):

((outMax-outMin)/(inMax-inMin))*(input-inMin)+outMin

This will work for inputs in the range you specify, and give funkiness for
number out of that range.  I attached a pd implementation.  Hope this helps!

Chadwick

> -----Original Message-----
> From: pd-list-admin at iem.kug.ac.at [mailto:pd-list-admin at iem.kug.ac.at]On
> Behalf Of Hans-Christoph Steiner
> Sent: Tuesday, March 18, 2003 11:03 AM
> To: pd-list at iem.kug.ac.at
> Subject: [PD] Range object
>
>
>
> I am looking for an object to change the range of numbers.  Specially, I
> am working with mice and joysticks, which output numbers in a specific
> range (screen resolution for mice; 0-65535 for usb joysticks).  I would
> like an object like this [ranger inMin inMax outMin outMax].
>
> Anyone seen something like this? I couldn't find anything in pdb.
>
> .hc
>
> 	zen
> 	   \
> 	    \
> 	     \
>
>
> _______________________________________________
> PD-list mailing list
> PD-list at iem.kug.ac.at
> http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ranger.pd
Type: application/octet-stream
Size: 469 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20030318/f5b09df6/attachment.obj>


More information about the Pd-list mailing list