Transport sync
Patterns are now anchored to the song position, not only to the step grid.
Pattern step n falls on song step n modulo the pattern length, so a pattern
always repeats at the same phase against the bar.
This fixes two long-standing reports (#5 huberp):
- Patterns starting late (typically by an eighth) rather than on the bar.
- Even-length patterns not repeating on the expected division. An eight-step
1/16 pattern now repeats exactly every half note, from the bar line.
The cause was that the engine kept steps on the beat but let the pattern sit at
any rotation against the bar, and the rotation left over from one chord carried
into the next and never corrected itself. Which rotation you got depended on
everything played since the plugin was loaded, which is why the symptom came
and went.
Also in this area:
- Host positions within a millionth of a step of a boundary are snapped onto
it. Hosts do not report exact fractions, and a position a hair short of a
boundary used to be read as a whole step still to go.
Known limitation
Patterns containing probability groups (pN (…):(…), or pN (…) with no
fallback) keep the step grid but are not phase-anchored. Such a pattern runs a
different number of steps depending on the roll, so there is no single length
to anchor against. See doc/architecture.md.
Not a bug
Rests were also reported as being twice as long as expected. They are not: a
single . lasts exactly one step, and a note ends exactly one step after it
starts. A pattern like 1.2..1.1 contains .., two consecutive rests, which
is genuinely an eighth at 1/16.