From 54f48a04bcb8f27642b00d07412582c4552606f6 Mon Sep 17 00:00:00 2001 From: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com> Date: Sun, 12 Jan 2025 19:06:30 +0530 Subject: [PATCH 1/2] fix:music keyboard to action conversion --- js/widgets/musickeyboard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/widgets/musickeyboard.js b/js/widgets/musickeyboard.js index 187a030bc9..47903cd68b 100644 --- a/js/widgets/musickeyboard.js +++ b/js/widgets/musickeyboard.js @@ -2980,7 +2980,7 @@ function MusicKeyboard(activity) { var actionGroups = parseInt(selectedNotes.length / actionGroupInterval) + 1; for (let actionGroup = 0; actionGroup < actionGroups; actionGroup++) { - let currentSelectedNotes = selectedNotes.slice( + const currentSelectedNotes = selectedNotes.slice( actionGroup * actionGroupInterval, (actionGroup + 1) * actionGroupInterval ); @@ -3039,8 +3039,8 @@ function MusicKeyboard(activity) { // note value is saved as a fraction newStack.push([idx + 2, "divide", 0, 0, [idx, idx + 3, idx + 4]]); - const maxWidth = Math.max.apply(Math, note.duration); - + const scaleFactor = 2.6666666665; + const maxWidth = Math.max.apply(Math, note.duration) / scaleFactor; const obj = toFraction(maxWidth); newStack.push([idx + 3, ["number", { value: obj[0] }], 0, 0, [idx + 2]]); newStack.push([idx + 4, ["number", { value: obj[1] }], 0, 0, [idx + 2]]); From 4b9d64f9cca14a1f00065429fbe18328a32aff05 Mon Sep 17 00:00:00 2001 From: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:40:16 +0530 Subject: [PATCH 2/2] delay between notes played removed for sync --- js/widgets/musickeyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/widgets/musickeyboard.js b/js/widgets/musickeyboard.js index 47903cd68b..69e614317d 100644 --- a/js/widgets/musickeyboard.js +++ b/js/widgets/musickeyboard.js @@ -965,7 +965,7 @@ function MusicKeyboard(activity) { this._createKeyboard(); } } - }, time * 1000 + 125); + }, time * 1000 ); }; /**