Hello,
I am using arrays of notes and I am wondering whether there is a simple way to choose the items of the array by skipping 1 note, 2 notes, 3 notes, etc. and to stop when the first item chosen repeats.
Let’s say I have this array:
[0,1,2,3,4,5,6,7,8,9,10,11];
and by skipping 0 items, 1 item, 2 items, 3 items, etc. I want to get these arrays:
skipping none: [0,1,2,3,4,5,6,7,8,9,10,11]
skipping one note: [0,2,4,6,8,10,0]
skipping two notes: [0,3,6,9,0]
skipping three notes: [0,4,8,0]
skipping four notes: [0,5,10,3,8,1,6,11,4,9,2,7,0] *
skipping 5 notes: [0,6,0]
skipping six notes: [0,7,2,9,4,11,6,1,8,3,10,5,0] *
skipping seven notes: [0,8,4,0] *
skipping eight notes: [0,9,6,3] *
skipping nine notes: [0,10,8,6,4,2,0] *
skipping ten notes: [0,11,10,9,8,7,6,5,4,3,2,1,0] *
skipping eleven notes: [0,0]
In the cases marked * , the initial array must be wrapped around to get all the values.
May be something so simple, but I just can’t figure it out. Thanks, JF