Loops
Last updated
Was this helpful?
Last updated
Was this helpful?
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:
- used to loop a given number of times
- used to loop once per item in a list
Start the loop by triggering the reset
input.
Once all iterations are complete, the done
output trigger is activated.
Trigger the loop by activating the reset
input.
The item
output provides the value of the current element, while the index
output gives its position in the list.
Once all items have been processed, the done output trigger is activated.
The node allows you to repeat a sequence of nodes a set number of times, determined by the iterations
input.
will then activate the on count
output trigger once per iteration, up to the specified number of times.
To continue looping, connect on count
to the next node(s) in your sequence, and then back to the count
input of . This advances to the next iteration.
The node allows you to loop through a list of items, executing a sequence of actions for each item in the list. Unlike a standard loop that runs a fixed number of times, automatically iterates over every element in a list, passing along both the current item
and its index
in the list.
For each item in the list, activates the on item
output trigger.