Forums > MaxMSP

getting random radiogroup settings, but none of the same

August 11, 2011 | 6:46 pm

I am trying to send random numbers from (1-9)to nine different radiogroup objects, but even though I want it to be random I still dont want any radiogroup setting to happen more than once – In otherwords I want to randomize where each parameters lands, but have no paramter controlled by more than one control input

– Pasted Max Patch, click to expand. –

Best regards.

August 11, 2011 | 7:12 pm

urn is your friend here

– Pasted Max Patch, click to expand. –
August 11, 2011 | 7:14 pm

I can’t view the example patch right now but a quick solution would be uzi 9, urn, thresh, then unpack to each radiogroup. Urn is the main object you want as it does random numbers without repetition. There is probably a better way to handle the routing than using thresh and unpack. The uzi’s "done" output can be used to reset the urn object.

edit: now that I think of it I believe urn has it’s own output to reset itself.

August 11, 2011 | 7:14 pm

Awsome. Thanks :)

August 11, 2011 | 9:10 pm

Something that might be interesting: since it’s permutations you’re interested in, check out the mxj list package. If you use permutations instead of randomly generating a list, you can always go back to something that was interesting, and you can explore various patterns that are similar. (try using drunk to traverse the permutation index) Just cache the previous value(s) of the permutation index in a coll and you now have a history!

– Pasted Max Patch, click to expand. –
August 11, 2011 | 9:41 pm

I’ve used urn in a similar fashion. If you seed urn externally, you can save an reload that seed if there’s something interesting. Here’s an example of a random counter that uses this idea:

– Pasted Max Patch, click to expand. –
Viewing 6 posts - 1 through 6 (of 6 total)