Fix drum pattern repeats: offset hit positions for each cycle

Hits were piling up at the same positions instead of being spread
across repeats. Now each repeat offsets by pattern.beats.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 11:10:07 -04:00
parent b97378c836
commit 772fa84b4f
+5 -2
View File
@@ -167,8 +167,11 @@ class Pattern:
A Score containing drum hits as MIDI percussion notes.
"""
score = Score(self.time_signature_str, bpm=bpm)
for _ in range(repeats):
score._drum_hits.extend(self.hits)
for r in range(repeats):
offset = r * self.beats
for hit in self.hits:
score._drum_hits.append(
_Hit(hit.sound, hit.position + offset, hit.velocity))
score._drum_pattern_beats += self.beats
return score