Issue when using pad inside ForEach

I have encountered two issues and have attached a minimal reproducible patch below:

  1. Spread ouput coming from ForEach flickers if a pad created inside foreach is used for Keep
  2. Spread outputs are different if a splicer value is passed to a pad and is then used vs used directly in a Keep

repro-patch.vl (20.1 KB)

The patch shows the issues I’m telling much better.

vvvv version: 6.6

This is an order of execution detail. Pads are read first when entering a scope (in your case an iteration of the loop) and written last. so effectively, they introduce one frame delay. in your case even a delay between two executions of the loop, because each iteration of the look has its own state and therefore its own pad.

Also not the each stateful scope (patch, loop, if, etc.) has its own state and even though pads can be named the same, different scopes have their own underlaying variable. That means the pads with the same name but in different scopes (levels of a patch) are not connected to each other.

So, do not use pads to get rid of links.

1 Like

Thank you. I was aware about the second part but not the first.

:( My for loops get messy pretty quick with links going around at all place. And sometimes I don’t want to refactor it into smaller nodes and operation. Do you suggest something else that I can do to make the content of a loop easier to follow?

Sounds like you’d want to bumb another highly requested feature:

1 Like

Thank you. I have upvoted in both GitHub and in the forum.

This was written with beta in mind, still a lot also applies to gamma:
https://beta.vvvv.org/using-vvvv/patching/software-engineering-patterns.html

1 Like