### controlled randomness

Hi.

I am currently selecting the data in a coll object at random and am looking to find a way to integrate a variable probability weighting for one specific number to be selected from it. I am aware that the prob object can be used to set the probability of numbers being selected from within a list, but the probability is relative to the other probabilities in that list. I wish to keep the selection of all the numbers from the coll random with the exception of one, and control the probability of this single number externally (from outside the list/coll).

e.g. numbers 1 – 9 all being selected at random (from within a coll) and 10 having a variable probability weighting ranging from 10-100%

Any help with this would be much appreciated.

Like this?

**all**of the following text. Then, in Max, select

*New From Clipboard*.

----------begin_max5_patcher---------- 672.3ocyV0rbZCCD9r4oPilbqTFjvle5zKsuFcxvHPKfZsWwXInjlIu6UR1N .oxDRHvzKRV6tZ829sqVoG6jPmo2AFJ4KjePRRdrSRRPjWPR85DZgX27bgIX FEgeqm8SZ2JUVXmMH9SDViLbSgByAavddsvEZzZT+A7xX860eus5M1FiY0RW KryWovkSKg41JvwyF61Dgyy7SC38x5RXNQj6q2SkarOrFp1.Ugts1nUICnzg 7OyoG.ITTDrm9sRkHm7cctj509TmN9gtWFoTJPotfL4VvLrIo9orggEuKlY7 UfYJ.iQrDtpLvXdnzXT+.ADFYCOEADM5GcEh9b0Vnmz4gFeuUT9rq+GkGQNr nr.+T0AS7QdEYjFJFRGcRVnKgtHWKhWLjQe9WU5PrEJmBnXVNbH3LhsfbpvZ KUy1Xg8eYpIkZVwG34a.8hFwMxOz85RIT5Mnt.3HkRXQ6JMqAPlqJBPqWLKT 3VkQUi9ntvBqMsoTfn1JrJMN84rGMhcvt0ZDPa63XCprF6CU3HKhAEt5mpyA 8i5fBWIR.lQ01jcYQo.k0UrcPVLJOrRWZasD8XnnkMfkOJJbx03xy2WmJvxU 3u7dp0Tj2AZYqgkBWnaMsERJUZqTFNk2L8wbUfZA4NE6q2o3D6J.c4WBja.h 6TImLSfKu7Njmn2.iMHzULaTUywzW+RBe2gnMFRuB8IcsLrZ7MzGj8pw5vPn x62L1djFX+XQ5fO9mB3NVeUuJrIQ2exdN388X.1aHMG1u6.N9xmRFPnW9wDl QuobdC.pe4AYOFkfwpvP+1CrgejMqTRIfGbbmVnjq0tnoFBj6il7NWDwOCD4 dw.gcyPT5Q+s3HZ7MkiR+uiixNCDkdSQD6LQzsKqM3LPD6BPjawSc9alYq15 -----------end_max5_patcher-----------

Thanks for the reply, and the patch!

It looks really helpful and i’m pretty sure it’ll do what i need. I’m just a little unsure as to how exactly it’s working.

Would you mind explaining the argument to me so that i am able to apply it to my project?

Thanks again

The patch controls the probability of number 10 with a live.dial ranging from 0-100%, and if 10 is not chosen another number 1-9 is randomly selected.

Forums > MaxMSP