Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Music Keyboard to Action Conversion Sync #4262

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/widgets/musickeyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ function MusicKeyboard(activity) {
this._createKeyboard();
}
}
}, time * 1000 + 125);
}, time * 1000 );
};

/**
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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]]);
Expand Down
Loading