Skipping steps in a note driven Step Sequencer

Aera's icon

I have this pretty straightforward sequencer that advances with each incoming midi note. So far so good - but I'd like to skip certain steps, without breaking the note on / off relationship. When I want to skip step 5 for example, the note pairs should be going to 0, 1, 2, 3, 4, 6, 7.

I also still want to be able to change the length of the loop itself.

I've made this kind of work with using zl.filter, zl.len, zl.nth and a counter, but off course this didn't keep my note offs in the correct destination.

Maybe route is not the right tool for this? Is there some kind of "round-robin" distributor where I can skip certain steps? A switch? Or can coll be used somehow?

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

Aera's icon

In case anyone ever has the same need, here's a pretty simple solution. I discovered you can change route's selector values dynamically, so I can remap my index 1, 0, 0, 1, 0, 1 to 1, 0, 0, 2, 0 3 with little javascript and send this into the route. You also have to change the number of counts accordingly. It will now work without breaking the note-on / off relationship! Granted I still have to flush when I change my steps, but that's good etiquette anyway I guess. Always flush after you gate.

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

Aera's icon

Can't upload .js here somehow so here's the code:

function list() {

var input = arrayfromargs(arguments);

var count = 0;

var output = input.map(function(val) {

if (val !== 0) {

count++;

return count;

}

return 0;

});

outlet(0, output);

}

Aera's icon

Oh joy! I just learned that borax flushes too when you reset with a bang.