iterate over list N times

newtfish's icon

Hi,

Im sure im being really stupid here, but....

Ive got a list like so:

1 2 3 4 5 6

And I would like it to iterate 8 times and for it to start from the beginning again, so the resulting list would be:

1 2 3 4 5 6 1 2

Im wondering if there is any simple way to do this in max?

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

this one's relatively simple, but follows your request quite closely:

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

BUT I don't like iterating when it can be avoided, so I thought it would be better to double the list, and chop off the excess.

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

but then I thought, hey, we know how long we want this list to be, and we know how long the incoming list is... so I think the best way of doing this is the following:

newtfish's icon

This is so cool! The last solution you posted is the ultimate in efficiency, but its the first one that fits my description perfectly, because the list can change in size.

Thanks Wetterberg.

metamax's icon

also.. variable list length w/ variable n+

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

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

I think this abstraction does what you want. (zl to the rescue)