mirror of
https://github.com/kennethreitz/pytheory.git
synced 2026-06-05 23:00:20 +00:00
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:
+5
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user