Skip to content

Commit 537f720

Browse files
adewaleclaude
andcommitted
fix: PitchOverview playhead wraps correctly for shorter patterns
When a track had fewer steps than MAX_STEPS (128), the playhead indicator in PitchOverview would stop highlighting after the first loop through the track's stepCount. For example, a 64-step track would show the playhead for steps 0-63, but nothing for steps 64-127. Root cause: The playhead check used `currentStep === i` but currentStep ranges 0-127 while the grid only has indices 0-63. Fix: Changed to `(currentStep % maxStepCount) === i` to wrap the global step position to the local grid size. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 672f2a5 commit 537f720

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/components/PitchOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const PitchOverview = memo(function PitchOverview({
161161
return (
162162
<div
163163
key={i}
164-
className={`pitch-bar-cell ${isBeatStart ? 'beat-start' : ''} ${isPageEnd ? 'page-end' : ''} ${isPlaying && currentStep === i ? 'playing' : ''} ${data.hasOutOfScale ? 'out-of-scale' : ''}`}
164+
className={`pitch-bar-cell ${isBeatStart ? 'beat-start' : ''} ${isPageEnd ? 'page-end' : ''} ${isPlaying && (currentStep % maxStepCount) === i ? 'playing' : ''} ${data.hasOutOfScale ? 'out-of-scale' : ''}`}
165165
title={data.pitches.length > 0
166166
? `Step ${i + 1}: ${data.pitches.map(p => pitchToNoteName(p)).join(', ')}`
167167
: `Step ${i + 1}: no notes`

0 commit comments

Comments
 (0)