Instancing on a rectangle outer edge? + Make this patch procedural?

I am slowly getting into Cables and your videos are just super @andro!

I am trying out a simple GIF-ish patch to get my feet wet and I have a few questions regarding making it more procedural:

  • First of all, is there a way to instance shapes on a rectangle edges (only the outer edges)?
  • Is there a way to have instances of these rectangles and feed them different time offsets (based on their index number)?

Right now I have a simplified version where I use two LinesArray that I rotate to make a rectangle.
As of now I have four rectangles. Let’s say I would like to make a procedural system with a slider where I can chose the amount of rectangles I want… How would I go about doing this?
I have set up the animation system in a subpatch and then I copy paste the amount of subpatches I need, and manually set the timeoffset based on the amount of copies. Not a very efficient way to do this.
I haven’t found a way to instance the subpatches in any meaningful way. I hope I have missed something?

Here is the patch:

Answering my own question regarding proceduralism and time offset:
I have managed to understand how the Repeat op works. Working with a for loop and indexes in a nodes context was a bit confusing at first, but I believe I have wrapped my head around it now.
If anybody is wondering about the same thing here is a new patch to dissect:

The Repeat op works on the CPU, now, I need to understand how to get the same stuff onto the GPU. So much fun stuff to learn :nerd_face: