Is there a way to output the numbers 1 through 6 at regular intervals without interruption and without repeating forever?

gogo's icon

Is there a way to output the numbers 1 through 6 at regular intervals without interruption and without repeating forever?

This is a patch for creating music.

I tried urn, but it didn't work.

TFL's icon

If you want your numbers in order from 1 to 6: [counter 6 1].

If you want them scrambled then you can use [urn 6] but you need to add a [+ 1] to raise its output from 0-5 to 1-6, and add a clear message connected between its rightmost outlet and its inlet (so that it starts over once it has finished outputing its 6 numbers):


gogo's icon

Thanks for your reply.

When one loop in urn ends, a bang is used to clear the output, cutting off numerical values.

The final value at the end of the first loop in urn may overlap with the first value at the end of the second loop.

That's the problem.

TFL's icon

Check out [urn-jb].

gogo's icon

If you have any patches that would be helpful, I would appreciate it if you could post them.

TFL's icon

[urn-jb] is an abstraction, you can double-click on it to see inside how it works. It even has an help file showing you how to use it.

This is as straightforward as it can be, this object is does exactly what you want, you don't need anything around it.

I don't post a patch here because how simple the problem is and how the builtin resources already provide you everything you need.

Roman Thilenius's icon

yes, urn alone will still allow repetitions between the last and the first.

to make sure that two successive numbers may not be identical you have to continiously compare any output against the last output, and if it is identical, block it and retrigger the source once more.

you can do only that, or combine it with inputs like you get from urn, where it is not always needed.

no-rep

gogo's icon
gogo's icon
Wil's icon

download zui~

not much else required


Pedro Santos's icon

Another suggestion, using standard Max objects.

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