how do i tailor RANDOM?

Nov 3, 2011 at 5:11pm

how do i tailor RANDOM?

i have a couple of RANDOM objects and need to tweak them slightly.

id like to spread the random choices out. so if it chooses x, it wont choose it again for a while.

and also, id like to be able to bias one of the RANDOM objects. so it randomly chooses from lower in the range more frequently, but with occasional choices from the upper range. for example, with a range of 0-20, it will more frequently choose within the region of 0-7, with occasional choices over that.

any help would be much appreciated

Nov 3, 2011 at 5:42pm
– Pasted Max Patch, click to expand. –
Nov 3, 2011 at 5:54pm

The table/itable object can also be used to create weighted random numbers, using bangs.

– Pasted Max Patch, click to expand. –
Nov 3, 2011 at 6:01pm

a couple of other ways… don’t you love Max, always a ton of different solutions :)

– Pasted Max Patch, click to expand. –
Nov 4, 2011 at 12:16pm

Basically what you want is a Markov chain (ie, a random number distribution with memory, taking the last several values generated into account when generating the next one). There is the [prob] object in Max that does Markov chains, but setting it up to do what you want takes a bit of work.

I had done some work on Markov chains specifically to do this sort of “don’t repeat the last N values” for the Litter Power package, but I don’t think the object was actually finished. I’m not at a machine where I can check the status, but if there’s interest I can have a look at the weekend.

Nov 4, 2011 at 3:50pm

There is interest!

Nov 4, 2011 at 6:05pm

good bye weekend.


You must be logged in to reply to this topic.