Random between +/- 128.0??

CKNY's icon

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...."

If you know how to do it, would you please pleas tell me?

thanks

CKNY's icon
keithmanlove's icon

here's one of many:

Max Patch
Copy patch and select New From Clipboard in Max.

It really helps to start thinking of numbers in max like this.

Keith

On 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...."
>
> If you know how to do it, would you please pleas tell me?
>
> thanks
>

Chris Muir's icon

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...."

Max Patch
Copy patch and select New From Clipboard in Max.

Scale will scale one number range to another. Something like:

-C

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

John MacCallum's icon

The message: uniform -128. 128.

will give you what you want.

JM

Peter Castine's icon

A belated but necessary response:

Max Patch
Copy patch and select New From Clipboard in Max.

The other solutions using the stock random object will only give you a limited resolution. For instance, Keith's solution will only give you numbers in increments of 0.1, it'll never give you a random value like 42.14159.

Lp.shhh will generate all possible values in the range from 0

These two objects are in the freeware Litter Starter Pack. For better or worse, the Starter Pack is still PPC-only in the Mac world, but UB versions are available with the Pro Bundle.

And all Litter Power versions give you much more interesting random number distributions to choose from.

Best,
Peter

Chris Muir's icon

At 12:00 AM +0200 8/3/07, Peter Castine wrote:
>The other solutions using the stock random object will only give you a limited resolution. For instance, Keith's solution will only give you numbers in increments of 0.1, it'll never give you a random value like 42.14159.

Well, my solution will give you fairly arbitrary resolution (repeated here with an added numberbox for variable resolution):

Max Patch
Copy patch and select New From Clipboard in Max.

It's probably not as good as the Litter solution, but the price is right.

-C

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

Peter Castine's icon

Quote: Chris Muir wrote on Fri, 03 August 2007 01:11
----------------------------------------------------
> It's probably not as good as the Litter solution, but the price is right.
----------------------------------------------------

I dunno, I always thought the price for Litter Power was pretty good.

Get your resolution up to 16777216 or so and your patch will do a pretty decent job.

Chris Muir's icon

At 9:48 PM +0200 8/5/07, Peter Castine wrote:
>I dunno, I always thought the price for Litter Power was pretty good.

I wasn't ragging on the Litter Power price, just pointing out that there was a standard-object-only solution to this particular problem.

-C

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

CKNY's icon

Quote: Chris Muir wrote on Sun, 05 August 2007 14:36
----------------------------------------------------
> At 9:48 PM +0200 8/5/07, Peter Castine wrote:
> >I dunno, I always thought the price for Litter Power was pretty good.
>
> I wasn't ragging on the Litter Power price, just pointing out that there was a standard-object-only solution to this particular problem.
>
> -C
>
> --
> Chris Muir | "There are many futures and only one status quo.
> cbm@well.com | This is why conservatives mostly agree,
> http://www.xfade.com | and radicals always argue." - Brian Eno
>
----------------------------------------------------

OK, maybe this is going to be more interesting.........

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.

thanks a lot,

CKNY's icon

Quote: John MacCallum wrote on Thu, 02 August 2007 12:02
----------------------------------------------------
> Check out randdist: http://www.cnmat.berkeley.edu/MAX/downloads/
>
> The message: uniform -128. 128.
>
> will give you what you want.
>
> JM
----------------------------------------------------

Hmm..........thank you for your information.....but it is weird, I got error message after I install randdist.

The first thing after I install randdist is to open the help file, but what I got are two errors:

error: inlet: wrong message or type
error: sqrt: doesn't understand "#2"

Guess I can not use randdist until I solve th problem. My computer is not Universal Binary, it is PPC, so I don't think it is because of my OS. Would you please tell me if you know what's the problem with those errors?

thank you so much

gusanomaxlist's icon

On 8/14/07, UCDMSRA wrote:
>
>
> Quote: Chris Muir wrote on Sun, 05 August 2007 14:36
> ----------------------------------------------------
> > At 9:48 PM +0200 8/5/07, Peter Castine wrote:
> > >I dunno, I always thought the price for Litter Power was pretty good.
> >
> > I wasn't ragging on the Litter Power price, just pointing out that there
> was a standard-object-only solution to this particular problem.
> >
> > -C
> >
> > --
> > Chris Muir | "There are many futures and only one status quo.
> > cbm@well.com | This is why conservatives mostly agree,
> > http://www.xfade.com | and radicals always argue." - Brian Eno
> >
> ----------------------------------------------------
>
> OK, maybe this is going to be more interesting.........
>
> 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.
>
> thanks a lot,

Hi.
Maybe using the table random probablilities could help you :

Max Patch
Copy patch and select New From Clipboard in Max.

FP's icon

> [36, 38, 40, 41, 42, 45, 47]

if it's only these numbers, why not using coll ?
and urn.

gusanomaxlist's icon

oops, forgot to include the content of coll in my previous patch...

Max Patch
Copy patch and select New From Clipboard in Max.

CKNY's icon

Quote: gusanomaxlist wrote on Tue, 14 August 2007 04:03
----------------------------------------------------
> oops, forgot to include the content of coll in my previous patch...
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 339 176 100 9109513 your 7 main numbers;
> #P message 166 109 32 9109513 size 4;
> #P newex 70 73 141 9109513 t b b b b clear;
> #P newex 70 50 45 9109513 loadbang;
> #P newex 275 120 27 9109513 t i b;
> #P button 275 62 15 0;
> #P newex 275 96 47 9109513 random 7;
> #N coll myNr 1;
> #T flags 1 0;
> #T 0 36;
> #T 1 38;
> #T 2 40;
> #T 3 41;
> #T 4 42;
> #T 5 45;
> #T 6 47;
> #P newobj 275 173 57 9109513 coll myNr 1;
> #P newex 236 302 26 9109513 print;
> #P newex 236 264 27 9109513 - 12;
> #P newex 198 264 27 9109513 + 12;
> #P newex 198 234 87 9109513 gate 3;
> #P message 134 109 26 9109513 3 50;
> #P message 102 109 26 9109513 2 25;
> #P message 70 109 26 9109513 1 25;
> #N vtable 4 25 70 235 237 970100 128;
> #P newobj 198 164 55 9109513 table;
> #P comment 25 134 100 9109513 probabilities (%);
> #P connect 13 0 14 0;
> #P connect 14 0 2 0;
> #P connect 14 1 3 0;
> #P connect 14 2 4 0;
> #P connect 14 3 15 0;
> #P connect 14 4 1 0;
> #P connect 15 0 1 0;
> #P connect 12 1 1 0;
> #P connect 4 0 1 0;
> #P connect 3 0 1 0;
> #P connect 2 0 1 0;
> #P connect 1 0 5 0;
> #P connect 5 0 6 0;
> #P connect 5 1 7 0;
> #P fasten 5 2 8 0 279 292 241 292;
> #P connect 7 0 8 0;
> #P fasten 6 0 8 0 203 292 241 292;
> #P connect 11 0 10 0;
> #P connect 10 0 12 0;
> #P connect 12 0 9 0;
> #P connect 9 0 5 1;
> #P window clipboard copycount 17;
>
>
>
----------------------------------------------------

wow, that's so great!! I didn't know I can use table as probabilities before. Talk about probabilities, if I need to random bunch of number like 0~100, but I hope to increase the probabilities of 4,8,9,11,13,16 to 30%, what is the best way to do that? I know it probably just take out the coll and use random or drunk, but how to connect table objects and do the trick?

thank you so much

CKNY's icon

Quote: gusanomaxlist wrote on Tue, 14 August 2007 04:03
----------------------------------------------------
> oops, forgot to include the content of coll in my previous patch...
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 339 176 100 9109513 your 7 main numbers;
> #P message 166 109 32 9109513 size 4;
> #P newex 70 73 141 9109513 t b b b b clear;
> #P newex 70 50 45 9109513 loadbang;
> #P newex 275 120 27 9109513 t i b;
> #P button 275 62 15 0;
> #P newex 275 96 47 9109513 random 7;
> #N coll myNr 1;
> #T flags 1 0;
> #T 0 36;
> #T 1 38;
> #T 2 40;
> #T 3 41;
> #T 4 42;
> #T 5 45;
> #T 6 47;
> #P newobj 275 173 57 9109513 coll myNr 1;
> #P newex 236 302 26 9109513 print;
> #P newex 236 264 27 9109513 - 12;
> #P newex 198 264 27 9109513 + 12;
> #P newex 198 234 87 9109513 gate 3;
> #P message 134 109 26 9109513 3 50;
> #P message 102 109 26 9109513 2 25;
> #P message 70 109 26 9109513 1 25;
> #N vtable 4 25 70 235 237 970100 128;
> #P newobj 198 164 55 9109513 table;
> #P comment 25 134 100 9109513 probabilities (%);
> #P connect 13 0 14 0;
> #P connect 14 0 2 0;
> #P connect 14 1 3 0;
> #P connect 14 2 4 0;
> #P connect 14 3 15 0;
> #P connect 14 4 1 0;
> #P connect 15 0 1 0;
> #P connect 12 1 1 0;
> #P connect 4 0 1 0;
> #P connect 3 0 1 0;
> #P connect 2 0 1 0;
> #P connect 1 0 5 0;
> #P connect 5 0 6 0;
> #P connect 5 1 7 0;
> #P fasten 5 2 8 0 279 292 241 292;
> #P connect 7 0 8 0;
> #P fasten 6 0 8 0 203 292 241 292;
> #P connect 11 0 10 0;
> #P connect 10 0 12 0;
> #P connect 12 0 9 0;
> #P connect 9 0 5 1;
> #P window clipboard copycount 17;
>
>
>
----------------------------------------------------

Oops, I forgot to ask you, what's the "size 4" doing in this patch?

thanks

John MacCallum's icon

Quote: CKNY wrote on Tue, 14 August 2007 02:54
----------------------------------------------------
> Quote: John MacCallum wrote on Thu, 02 August 2007 12:02
> ----------------------------------------------------
> > Check out randdist: http://www.cnmat.berkeley.edu/MAX/downloads/
> >
> > The message: uniform -128. 128.
> >
> > will give you what you want.
> >
> > JM
> ----------------------------------------------------
>
> Hmm..........thank you for your information.....but it is weird, I got error message after I install randdist.
>
> The first thing after I install randdist is to open the help file, but what I got are two errors:
>
> error: inlet: wrong message or type
> error: sqrt: doesn't understand "#2"
>
> Guess I can not use randdist until I solve th problem. My computer is not Universal Binary, it is PPC, so I don't think it is because of my OS. Would you please tell me if you know what's the problem with those errors?
>
> thank you so much
----------------------------------------------------

Sorry about that--those errors are from a bug in the help patch and are harmless. I've already fixed it and will release it soon.

John

CKNY's icon

Quote: John MacCallum wrote on Tue, 14 August 2007 10:05
----------------------------------------------------
> Quote: CKNY wrote on Tue, 14 August 2007 02:54
> ----------------------------------------------------
> > Quote: John MacCallum wrote on Thu, 02 August 2007 12:02
> > ----------------------------------------------------
> > > Check out randdist: http://www.cnmat.berkeley.edu/MAX/downloads/
> > >
> > > The message: uniform -128. 128.
> > >
> > > will give you what you want.
> > >
> > > JM
> > ----------------------------------------------------
> >
> > Hmm..........thank you for your information.....but it is weird, I got error message after I install randdist.
> >
> > The first thing after I install randdist is to open the help file, but what I got are two errors:
> >
> > error: inlet: wrong message or type
> > error: sqrt: doesn't understand "#2"
> >
> > Guess I can not use randdist until I solve th problem. My computer is not Universal Binary, it is PPC, so I don't think it is because of my OS. Would you please tell me if you know what's the problem with those errors?
> >
> > thank you so much
> ----------------------------------------------------
>
> Sorry about that--those errors are from a bug in the help patch and are harmless. I've already fixed it and will release it soon.
>
> John
>
----------------------------------------------------

ehh?......do you mean the object still can be used? But when I try to click (click metro), nothing happened.......I also tried the other one but still nothing happened. This object seems very nice and I really hope I can use it one day :)

thanks

Chris Muir's icon

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:

Max Patch
Copy patch and select New From Clipboard in Max.

-C

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

CKNY's icon

Quote: Chris Muir wrote on Tue, 14 August 2007 13:37
----------------------------------------------------
> 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
> #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
> #P comment 89 32 172 196617
> #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@well.com | This is why conservatives mostly agree,
> http://www.xfade.com | and radicals always argue." - Brian Eno
>
----------------------------------------------------

Hi Chris,

Your demo patch is very nice. I never thought that I can use table to build probabilities. I am sorry if this question is really silly, I think I understand what you said and what your patch doing. I also know how to use table.......but I don't understand how to set probabilities of table. In you example, there are several 64 and 127, what does that means? I mean, is it the probabilities 64 and 127 will come out if the result?

I tried to figure out but I can not connect the way of building probability table. For example, if I hope the number 1,3,5,7,13 have 25% chance, what's the table should look like? How to build it?

At the end, which object I can use for reading the random result from result table so that I can send the result numbers to other patches?

thank you so much

Chris Muir's icon

At 6:23 PM -0600 8/14/07, UCDMSRA wrote:
>Your demo patch is very nice. I never thought that I can use table to build probabilities. I am sorry if this question is really silly, I think I understand what you said and what your patch doing. I also know how to use table.......but I don't understand how to set probabilities of table. In you example, there are several 64 and 127, what does that means? I mean, is it the probabilities 64 and 127 will come out if the result?

When you bang a table, it treats the data in it roughly as probabilities for that address. For example if the table had data only at address 1, when you bang it, it would only output 1. The, probably simplistic, way I think of this is that the value at an address is the probability that that address will be output (as data). It sort of turns the table on its head, the address is the output data, and the data at an address is the probability of that address being output.

The significance of the 64 and 127 is that they are at a 2:1 ratio (although I should have used 64 instead of 64). It might as well have been 1 and 2 instead of 64 and 127.

The manual has more to say on this.

>I tried to figure out but I can not connect the way of building probability table. For example, if I hope the number 1,3,5,7,13 have 25% chance, what's the table should look like? How to build it?

A 25% chance compared to what?

>At the end, which object I can use for reading the random result from result table so that I can send the result numbers to other patches?

I'm not sure what you mean by this. Could you clarify?

-C

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

CKNY's icon

Quote: Chris Muir wrote on Tue, 14 August 2007 23:44
----------------------------------------------------
> At 6:23 PM -0600 8/14/07, UCDMSRA wrote:
> >Your demo patch is very nice. I never thought that I can use table to build probabilities. I am sorry if this question is really silly, I think I understand what you said and what your patch doing. I also know how to use table.......but I don't understand how to set probabilities of table. In you example, there are several 64 and 127, what does that means? I mean, is it the probabilities 64 and 127 will come out if the result?
>
> When you bang a table, it treats the data in it roughly as probabilities for that address. For example if the table had data only at address 1, when you bang it, it would only output 1. The, probably simplistic, way I think of this is that the value at an address is the probability that that address will be output (as data). It sort of turns the table on its head, the address is the output data, and the data at an address is the probability of that address being output.
>
> The significance of the 64 and 127 is that they are at a 2:1 ratio (although I should have used 64 instead of 64). It might as well have been 1 and 2 instead of 64 and 127.
>
> The manual has more to say on this.
>
>
> >I tried to figure out but I can not connect the way of building probability table. For example, if I hope the number 1,3,5,7,13 have 25% chance, what's the table should look like? How to build it?
>
> A 25% chance compared to what?
>
>
> >At the end, which object I can use for reading the random result from result table so that I can send the result numbers to other patches?
>
> I'm not sure what you mean by this. Could you clarify?
>
> -C
>
> --
> Chris Muir | "There are many futures and only one status quo.
> cbm@well.com | This is why conservatives mostly agree,
> http://www.xfade.com | and radicals always argue." - Brian Eno
>
----------------------------------------------------

Hi,

Yeah, I think I got it. For the building probabilities of the table, I understand what you means and I know how to build the table now. Thank you so much.

Sorry for my English makeing you confused. Although I understand how the probability table working, I still can not make this to other case. I hope I can build a patch run a 0~100 random numbers, but there are 5 numbers' (for example: 1,3,5,7,11) probabilities are 20 times more then others. So, if in the original random case each number has 1% probability, I would like to let those 5 numbers have 20% probabilities compared to other numbers.

For what I understand right now, I probably need to build a 100x100 table which have y = 1,3,5,7,11 and x=20 in each y position. Please correct me if I was wrong.

At the last part, I still can not figure out how to build the whole patch. If I use the same way you show me (probability table and result table), I hope I can use something which be able to read results from the results table and express properly. I hope I can use something to read the result table and unpack it so that I will get the whole results numbers once at a time. Is it possible?

I hope you can understand what I try to say and I am very appreciate your patience and kindly help.

thank you so much

Chris Muir's icon

At 8:44 AM -0600 8/15/07, UCDMSRA wrote:
>For what I understand right now, I probably need to build a 100x100 table which have y = 1,3,5,7,11 and x=20 in each y position. Please correct me if I was wrong.

If you swap your X and Y, I believe that is more of less correct. Remember, for this use of the table object, the probabilities are on the Y axis, and the data for those probabilities are the X axis. So I made a table with all positions on the X axis set to 1, except for positions 1, 3, 5, 7 and 11, which are set to 20.

At the end of this email is the same patch with the new probabilities in the table

>At the last part, I still can not figure out how to build the whole patch. If I use the same way you show me (probability table and result table), I hope I can use something which be able to read results from the results table and express properly. I hope I can use something to read the result table and unpack it so that I will get the whole results numbers once at a time. Is it possible?

The result table was just in my patch to show that it was statistically working. All you really need is to bang the probabilities table every time you need a new number. The only part you really need to care about is in green in the included version of the patch.

>I hope you can understand what I try to say and I am very appreciate your patience and kindly help.

No worries. Here's the modified patch with your new probabilities in it:

Max Patch
Copy patch and select New From Clipboard in Max.

-C

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

CKNY's icon

Quote: Chris Muir wrote on Wed, 15 August 2007 10:39
----------------------------------------------------
> At 8:44 AM -0600 8/15/07, UCDMSRA wrote:
> >For what I understand right now, I probably need to build a 100x100 table which have y = 1,3,5,7,11 and x=20 in each y position. Please correct me if I was wrong.
>
> If you swap your X and Y, I believe that is more of less correct. Remember, for this use of the table object, the probabilities are on the Y axis, and the data for those probabilities are the X axis. So I made a table with all positions on the X axis set to 1, except for positions 1, 3, 5, 7 and 11, which are set to 20.
>
> At the end of this email is the same patch with the new probabilities in the table
>
>
> >At the last part, I still can not figure out how to build the whole patch. If I use the same way you show me (probability table and result table), I hope I can use something which be able to read results from the results table and express properly. I hope I can use something to read the result table and unpack it so that I will get the whole results numbers once at a time. Is it possible?
>
> The result table was just in my patch to show that it was statistically working. All you really need is to bang the probabilities table every time you need a new number. The only part you really need to care about is in green in the included version of the patch.
>
>
> >I hope you can understand what I try to say and I am very appreciate your patience and kindly help.
>
> No worries. Here's the modified patch with your new probabilities in it:
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 124 129 124 196617
> #P comment 81 31 172 196617
> #P button 54 31 15 0;
> #P newex 54 50 50 196617 uzi 1000;
> #P button 54 109 15 0;
> #P comment 123 238 140 196617
> #P message 115 199 33 196617 clear;
> #N vtable 128 779 281 1400 844 989800 128 results;
> #P newobj 54 235 67 196617 table results;
> #P newex 54 211 46 196617 histo;
> #B color 5;
> #N vtable 100 30 89 940 871 989816 128 probs2;
> #T set 0 1 20 1 20 1 20 1 20 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1;
> #P newobj 54 130 66 196617 table probs2;
> #P user panel 38 99 252 75;
> #X brgb 204 242 207;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P connect 4 0 2 0;
> #P connect 4 0 3 0;
> #P connect 8 0 7 0;
> #P connect 7 0 6 0;
> #P connect 6 0 1 0;
> #P connect 1 0 2 0;
> #P connect 2 0 3 0;
> #P connect 2 1 3 1;
> #P window clipboard copycount 11;
>
> -C
>
> --
> Chris Muir | "There are many futures and only one status quo.
> cbm@well.com | This is why conservatives mostly agree,
> http://www.xfade.com | and radicals always argue." - Brian Eno
>
----------------------------------------------------

Hi Chris,

Just want to say thank you. Now I know how to play the probability game and this is really useful because I can put this anywhere I want in my project. The music part in my project because far far better compared to before. You are a very nice guy and a very good teacher. Thank you so much :)

CK

seejayjames's icon

Chris, that's a great patch and opened up some new insights for generating numbers... turning the table on its head, I love it. Great for visualizing probabilities etc., especially as you can draw them and see the results right away.

Thanks!

CJ