I had an idea for an alternate Yarns sequencer, inspired by the ER-101 sequencer.
Instead of uniform-length steps, each step would be of variable length. Each step would have two additional parameters: Step Length and Gate Length. Step Length is the duration of the step in terms of clock pulses. The Gate Length is the portion of the step in which the gate is on. Hold the Tie button and turn the encoder to set the Gate Length. Hold the Rest button and turn the encoder to set the Step Length. Note pitch is entered as previously.
It seems this could be implemented without any additional sequencer storage if we sacrifice note velocity. Here’s the existing memory layout for each sequencer step (SequencerStep in the code):
// BYTE 0:
// 0x00 to 0x7f: note
// 0x80: rest
// 0x81: tie
//
// BYTE 1:
// 7 bits of velocity + 1 bit for slide flag.
Replacing velocity gives us 7 bits to work with. If we have a maximum step length of 8, we only need 6 bits to encode both step length and gate length. Or, we could use more memory and achieve longer lengths, if the hardware is capable of it.
Another option would be to represent ties and rests explicitly like the existing firmware, but have variable step length (no variable gate length). In this case, we would have all 7 bits of velocity to work with, for steps of length up to 127. However, it might be best to limit the length to 99 since we have a two-digit display.
Note that holding the buttons would only be activated in record mode so I believe it would not interfere with the latching behavior.
Thoughts?