Forums > MaxMSP

creating a nested loop

September 15, 2013 | 3:17 am

I am trying to get a nested loop with metro, count and uzi.
But I am finding it difficult.

In tcsh this could be:
foreach (1 2 3)
foreach (1 2 3 4)

end
end

In matlab it would be
for i = 1:3
for j = 1:4

end
end

but in Max?
See enclosed map, which does not work.

<code>

– Pasted Max Patch, click to expand. –

</code>

please help.
G


September 15, 2013 | 4:50 am

You didn’t really say what you wanted your patch to *do*, but if I’m correct in assuming you want it to draw vertical bars of random length, then the fix is in the message ordering – hope this helps:

<code>

– Pasted Max Patch, click to expand. –

</code>

(ninja-edit that also fixes another bug in the design) (and even more compact)


September 15, 2013 | 9:12 am

Fantastic!!!!
thank you.
G


Viewing 3 posts - 1 through 3 (of 3 total)