weighted random generator

karl krach's icon

i’m struggeling with some littel logical problem and unfortunately i am not good with this kind of stuff, never have been… anyway. what i need is something like this:

i want to randomly switch between eight inputs, 1-8.
but each of these inputs should have a probability of getting switched to. that is between 0 (little likely) and 127 (most likely).

how would i construct a random generator which would behave that way?
i attached a patch which might explain better what i am looking for…

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

as always, heaps of thanks!!!
k

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

If I'm understanding you correctly, table more or less does what you want.

karl krach's icon

that works! itable... how could i have guessed? i mean, usually things with an "i" in front are not that flexible...
anyway, thanks a lot and a have a nice weekend!
k

Chris Muir's icon

table would work as well, if you didn't want the graphic part of it.