Skip to content

Commit

Permalink
fix applyAccidentals
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Aug 24, 2021
1 parent 23bde7d commit 1f4d423
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/accidental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ export class Accidental extends Modifier {
// modified the accidental state
const previouslyModified = modifiedPitches.indexOf(pitch) > -1;

// Remove accidentals
note.getModifiers().forEach(function (modifier, index) {
if (modifier instanceof Accidental && modifier.getIndex() == keyIndex) {
note.getModifiers().splice(index, 1);
}
});

// Add the accidental to the StaveNote
if (!sameAccidental || (sameAccidental && previouslyModified)) {
// Modify the scale map so that the root pitch has an
Expand Down

0 comments on commit 1f4d423

Please sign in to comment.