From 96d719d06c1274692ed2c5f117b5c5fc7e14efc5 Mon Sep 17 00:00:00 2001 From: adrien Date: Mon, 26 Aug 2024 02:19:40 +0200 Subject: [PATCH] filter notes --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 4af89f5..cdb1850 100644 --- a/app.js +++ b/app.js @@ -385,7 +385,7 @@ async function nextLevel() { noteSprites = [] midiSong.tracks.forEach(track => { //console.log(track.name) - track.notes.forEach(note => { + track.notes.filter(note => FIRST_NOTE <= note.midi && note.midi <= LAST_NOTE).forEach(note => { let noteSprite let durationInQuarter = note.durationTicks / midiSong.header.ppq if (durationInQuarter <= 0.25) noteSprite = new Sixteenth(canvasCtx, note.midi, 1000*note.duration)