Fix BPM calculation: 24 ticks = 1 quarter note, not per-tick

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 19:29:01 -04:00
parent 54659d39b1
commit 91d16595b7
+4 -3
View File
@@ -355,9 +355,10 @@ class LiveEngine:
if len(self._clock_times) > 48:
self._clock_times = self._clock_times[-48:]
if len(self._clock_times) >= 24:
interval = (self._clock_times[-1] - self._clock_times[-24]) / 24
if interval > 0:
self._bpm = 60.0 / interval
# Time span of 24 clock ticks = 1 quarter note
quarter_note_time = self._clock_times[-1] - self._clock_times[-24]
if quarter_note_time > 0:
self._bpm = 60.0 / quarter_note_time
# Trigger drum hits at the right time
if self._drum_pattern and self._drum_channel: