Patches

Loop Filter

Loop Filter

This is a very powerful patch that can do a lot of things! It can filter items out of a loop, but it can also repeat items in a loop. It can even be used to create a new loop with a single value repeated X times.

The idea is that you pass in two loops. The values loop is what you want to modify — you either want to remove items or repeat items in this loop. The second loop you pass in tells us how many times each value should appear (or if it should be removed by repeating 0 times).

Example A: Filter to a subset of a loop.

Input
apple
carrot
orange
Include
 
Output
apple
orange

Example B: Make a new loop by repeating a single value X times.

Input
apple
Include
5
Output
apple
apple
apple
apple
apple

Example C: Repeat and filter values by using a loop of numbers.

Input
apple
carrot
orange
Include
0
3
1
Output
carrot
carrot
carrot
orange

Right-click the patch to change the expected type of the Input loop.

Use Loop Builder to make a boolean or number loop.

Loop Filter

  • Input
  • Include
  • Loop
  • Index

Input

A loop of values.

Include

A loop of booleans (to include or not include), or a loop of numbers (to decide how many times a value is repeated).

Loop

The result loop, with values either filtered or repeated

Index

A loop of indices for the result loop