clear [urn ] without without repeating.

evanlivingston's icon

I'm looking to play files from a folder in a randomized order without repeating, urn allows me to do this except I want to start over again after it's played every file. To do this I need to send urn both a seed 1 message and clear message. The problem is I have to bang urn once AFTER it has gone through all the numbers so it send a bang out which I use to send the clear and seed messages. The last bang does not generate a new number which would make a sfplay~ object play the same file again.

Any ideas for solutions?

Here is a simple version of the problem

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

Szrp's icon

If I understand correctly, you want urn to give out a new number at every bang, starting again right after it has given out all numbers?

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

Have you tried this:

evanlivingston's icon

That's it, thank you! I cannot wait for the days when I understand max properly

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

Here's a patch I find handy, called UrnCounter:

MIB's icon

there is also the abstraction [urn-jb] in the Max5/examples folder. might be worth a look.