how to make a random pick from list ?

Sep 10, 2009 at 2:55am

how to make a random pick from list ?

- I have 6 switches (on-off)(toggles for the moment);
- With some “if” objects, the combination of each(6) switch state (on or off) should generate a list of int (1 to 9) ;
- I want to randomly pick a number from that (dynamic) list(or message… I don’t know).

My questions :
- Witch object should i use to store that list ?
- Witch object(s) i need to pick an int from it ?

#45409
Sep 10, 2009 at 7:20am

hi,

have a look to [zl lookup]

Ch

#163697
Sep 10, 2009 at 8:38am

People used to use James McCartney’s alea object to do this.

The object was orphaned years ago, but lp.ale is a living reincarnation. Give it a list and it will choose one item at random.

Lp.ale is part of Litter Power and included in the free Litter Starter Pack. This runs on Max 5 (despite the Max Window’s complaints) but is happier on Max 4.

The version in Litter Pro will run on both Max 5 and Max 4.

#163698
Sep 10, 2009 at 2:25pm

I just installed Litter Power on MAC with max5. It does not work.
I just installed Little Power on PC with max4.6. Some objects are still available but there is no object lp.ale.

Do someone have an other solution ?

#163699
Sep 10, 2009 at 3:00pm

isn’t it what you’re looking for?

– Pasted Max Patch, click to expand. –
#163700
Sep 10, 2009 at 3:11pm

Thanx everybody. I found how.
There it is….

#163701
Sep 10, 2009 at 3:15pm

For the future…
I am really beginner and want to know :
What should I do when you send me TEXT MAX patcher like you did ?

#163702
Sep 10, 2009 at 7:17pm
#163703
Sep 10, 2009 at 7:53pm
doubi73 wrote on Thu, 10 September 2009 16:25
I just installed Litter Power on MAC with max5. It does not work.

I just (re-)tested lp.ale 1.0 from Litter Power 1.7.1 (the current Starter Pack version) with Max 5.0.7. Works fine here (see screen shot–the .help file is also the Max 4 version, hence the wonky alignment after Max 5′s conversion).

Thank you for pointing out that lp.ale was inadvertently not included in the Windows distribution of the Starter Pack. This will be updated shortly.

#163704
Sep 10, 2009 at 8:42pm

random and zl nth will do.

#163705
Sep 10, 2009 at 8:51pm

this is actually an interesting way to select a random list element. I would have done this, but you do it with few objects.

– Pasted Max Patch, click to expand. –
#163706
Sep 10, 2009 at 9:25pm

Did you have a look to what I posted?
quite the same Smile

#163707
Sep 11, 2009 at 12:33am

I tried but…i have difficulties to copy and paste a patch.
I don’t know why.
I will ask a friend in montreal…to try with me.
tanx a lot Smile

#163708
Sep 11, 2009 at 3:11pm

Just for the fun, you can also use the scramble mode of zl.

– Pasted Max Patch, click to expand. –
#163709
Sep 11, 2009 at 3:22pm

WOW …less is more !
I will use your way !

#163710
Sep 27, 2009 at 11:46am
Peter Castine wrote on Thu, 10 September 2009 10:38
People used to use James McCartney’s alea object to do this.

The object was orphaned years ago…

There was no alea object in James McCartney’s orphaned collection according to my copies of it. (Which for sure reincarnated in Super Collider…)

But there is a (still alive) alea object in the RTC library, basically the same as the other suggestions as abstraction.
My favorite is the zl scramble though, unless you need DOD certified randomness…

Stefan

#163711
Sep 27, 2009 at 9:44pm

Thanks…finally i found this solution too….a zl scramble with a zl mth

#163712
Sep 8, 2013 at 3:42pm

Resurrecting this post but how would I go about reversing this process? I am looking to take a list such as ’1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0′ and ‘mutate’ it slightly by changing a specified number of 0′s into 1′s at random without changing the existing 1′s. I’ve been going through the ZL help files but I can’t join the dots on how to achieve this. Any help would be much appreciated and even more appreciated if this was achievable with no externals… Thanks in advance!

#264664

You must be logged in to reply to this topic.