Loops
Looping in Midio is as simple as connecting nodes in a loop. This can however easily create infinite loops if we don’t branch out of the loop at some point.
There are two main helper functions in Midio that makes it easy to prevent infinite loops:
For

The For node allows you to repeat a sequence of nodes a set number of times, determined by the iterations input.
Start the loop by triggering the
resetinput.Forwill then activate theon countoutput trigger once per iteration, up to the specified number of times.To continue looping, connect
on countto the next node(s) in your sequence, and then back to thecountinput ofFor. This advances to the next iteration.Once all iterations are complete, the
doneoutput trigger is activated.
For Each

The For Each node allows you to loop through a list of items, executing a sequence of actions for each item in the list. Unlike a standard For loop that runs a fixed number of times, For Each automatically iterates over every element in a list, passing along both the current item and its index in the list.
Trigger the loop by activating the
resetinput.For each item in the list,
For Eachactivates theon itemoutput trigger.The
itemoutput provides the value of the current element, while theindexoutput gives its position in the list.Once all items have been processed, the done output trigger is activated.
Last updated
Was this helpful?