XML Feeds

.

[maxmsp] Re: Random between +/- 128.0??

Chris Muir cbm at well.com
Tue Aug 14 13:37:36 MDT 2007


At 1:58 AM -0600 8/14/07, UCDMSRA wrote:
>What if I only want to random 7 different numbers and their scales of 12? I mean, what I want is only random the following numbers:
>
>[36, 38, 40, 41, 42, 45, 47] and the numbers add/sub (+/-) by those numbers, which is [36 +/- 12, 38 +/- 12, 40 +/- 12....], so there are totally 21 different numbers I ONLY want to random. I know maybe I need to use [iter] or [uzi] so that I can random 7 numbers at one time but I don't know how to random numbers I only need
>
>Please give me some directions, it will be better if I can increase the probabilities of the first set numbers [36, 38, 40, 41, 42, 45, 47]. For example, the probabilities of [36, 38, 40, 41, 42, 45, 47] coming out is 2 times more then others.

It looks like you are trying to build some sort of quantized random note generator. In my work, I tend to have the random processes and the quantizing process be independent. I have a variety of things that generate random numbers in several flavors, and I have a couple flavors of quantizers, that conform the random processes to specific scales.

That said, as usual with Max, there are a number of ways to do what you want. A table would get you there quite easily:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 141 254 140 196617 <- open to look at the results;
#P message 80 206 33 196617 clear;
#P button 72 32 15 0;
#P newex 72 51 50 196617 uzi 1000;
#N vtable 128 779 281 1400 844 989800 128 results;
#P newobj 72 251 67 196617 table results;
#P newex 72 227 46 196617 histo;
#B color 5;
#P number 83 153 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 72 110 15 0;
#N vtable 128 686 44 1301 666 989816 128 probs;
#T set 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 0 64 0 64 64 64 0 0 64 0 64 127 0 127 0 127 127 127 0 0 127 0 127 64 0 64 0 64 64 64 0 0 64 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#P newobj 72 129 60 196617 table probs;
#P comment 133 130 124 196617 <- a table of probabilities;
#P comment 89 32 172 196617 <- hit me to generate some numbers;
#P connect 2 0 5 0;
#P connect 2 0 4 0;
#P connect 9 0 5 0;
#P connect 8 0 7 0;
#P connect 7 0 3 0;
#P connect 5 1 6 1;
#P connect 5 0 6 0;
#P connect 3 0 2 0;
#P window clipboard copycount 11;

-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