From 1628a34ea0bd699cfdd6658ffeef77b6f51db27a Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 19:31:36 +0700 Subject: [PATCH] fix: ghost overlap use inclusive boundary for adjacent items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed itemEndBeat <= windowStartBeat → < and noteAbsEnd <= windowStartBeat → < so abutting items (Item 1 ends at bar 1, Item 2 starts at bar 1) show ghost notes from the adjacent item. --- app/static/js/services/ghostNoteExtractor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/static/js/services/ghostNoteExtractor.js b/app/static/js/services/ghostNoteExtractor.js index 119dc21..bf02e01 100644 --- a/app/static/js/services/ghostNoteExtractor.js +++ b/app/static/js/services/ghostNoteExtractor.js @@ -32,7 +32,7 @@ var itemStartBeat = item.startTime / secondsPerBeat; var itemEndBeat = (item.startTime + item.duration) / secondsPerBeat; - if (itemStartBeat >= windowEndBeat || itemEndBeat <= windowStartBeat) continue; + if (itemStartBeat >= windowEndBeat || itemEndBeat < windowStartBeat) continue; var notes = item.notes || []; for (var k = 0; k < notes.length; k++) { @@ -40,7 +40,7 @@ var noteAbsStart = itemStartBeat + (note.start_beat || 0); var noteAbsEnd = noteAbsStart + (note.duration_beats || 1); - if (noteAbsStart >= windowEndBeat || noteAbsEnd <= windowStartBeat) continue; + if (noteAbsStart >= windowEndBeat || noteAbsEnd < windowStartBeat) continue; var clampedStart = Math.max(noteAbsStart, windowStartBeat); var clampedEnd = Math.min(noteAbsEnd, windowEndBeat);