XML Feeds

.

[maxmsp] Random between +/- 128.0??

Chris Muir cbm at well.com
Wed Aug 1 17:54:25 MDT 2007


At 5:13 PM -0600 8/1/07, UCDMSRA wrote:
>Hi,
>
>I think maybe I didn't sleep very well these days so when I need to create a random number between +128.0 and -128.0, my brain suddenly stopped and feels like empty.....
>
>I know "random" can only make 0+ numbers. I also think of the possibilities by put "-" after random to make the number below 0....however, I still want to make "real" random number between +/-128.0 and it is must be float number, so the result will be something like "9.5, -4.8, 25.4, 46.7, 53.6, -42,1...."

Scale will scale one number range to another. Something like:
#P button 58 89 15 0;
#P window setfont "Sans Serif" 9.;
#P flonum 58 149 70 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 58 129 140 196617 scale 0 10000 -128. 128.;
#P newex 58 108 76 196617 random 10000;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P connect 3 0 0 0;
#P window clipboard copycount 4;

-C

-- 
Chris Muir           | "There are many futures and only one status quo.
cbm at well.com         |  This is why conservatives mostly agree,
http://www.xfade.com |  and radicals always argue." - Brian Eno


More information about the maxmsp mailing list