How to omit certain numbers from [random] output based on zl filter list?

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

In the patch below, I've figured out how to filter certain numbers out of a randomly generated stream, but when I press the bang at the top of the patch, I want it to return a new number right away. As of now, I have to keep pressing the random button until it returns a number which is not on the filtered list in order to generate a new number. Somehow, I need to tell the [random] object which numbers to skip or find some other work around so I get a new number in the message box to the right every time I hit the bang at the top.

Christopher Dobrian's icon

Are you aware of the [urn] object?

Gmix's icon

Yes, I know how urn works but that doesn't help me here. I want the user to decide when it is time to add certain numbers to the filter list. Urn would just simply eliminate one number each time automatically.

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

table is a great random generator

Gmix's icon

Awesome, great solutions! didn't realize [table] could be used as a random generator when given bangs instead of integers. Thanks a lot guys!