diff --git a/js/widgets/musickeyboard.js b/js/widgets/musickeyboard.js index 15bc7dd91f..3f6a57a5fe 100644 --- a/js/widgets/musickeyboard.js +++ b/js/widgets/musickeyboard.js @@ -983,7 +983,7 @@ function MusicKeyboard(activity) { this._createKeyboard(); } } - }, time * 1000 + 125); + }, time * 1000 ); }; /** @@ -3009,7 +3009,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 ); @@ -3068,8 +3068,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]]);