Trouble with outputting selected items from the list

Just Evan's icon

Hi. I am using repeating patterns in the format “1 0 1 0 0” where “1” means we are grabbing an item from the list at that moment.

Example:

A B C D E F G H I J - Main list.

1 0 0 1, 1 0 0 1, 1 0 0 1 - Repeating pattern.

It should come out: A D E H I

I am facing a problem with the output. When I first run the patch - the output is correct, but when I run it again the output shifts a bit, instead of the first item in the list I get the last one.

I can't figure out what the problem is.

My patch:

Max Patch
Copy patch and select New From Clipboard in Max.

Edit #1: I think the problem is that the list is not divided by the number of elements in the pattern (4), for example if the list has 5 elements, then with the pattern "1 0 0 1" the last one will fire the trigger, after which [ buddy] will expect a list (2nd element), this (seems) to start from the last (5th) character. In any case, I still haven't found a solution to the problem.

double_UG's icon

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Max Patch
Copy patch and select New From Clipboard in Max.
Just Evan's icon

double_UG, Thank you very much! Everything turned out to be much simpler)

Just Evan's icon

double_UG, it looks like it's necessary to add [t b l] after the input list to avoid confusion if the list is shorter ;)

Source Audio's icon

use zl.iter 4, and it will do what you want