Skip to content

Commit

Permalink
allow chords to have no stem
Browse files Browse the repository at this point in the history
also remove flags on noStem notes.
  • Loading branch information
mscuthbert committed Jun 11, 2024
1 parent f6dc7d5 commit 751d285
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,15 @@ export class NotRest extends GeneralNote {
this.activeVexflowNote = vfn;
return vfn;
}

override vexflowAccidentalsAndDisplay(vfn: VFStaveNote, _options: {} = {}): void {
super.vexflowAccidentalsAndDisplay(vfn, _options);
if (this.stemDirection === 'noStem') {
vfn.glyphProps.stem = false;
vfn.glyphProps.flag = false;
// vfn.render_options.stem_height = 0;
}
}
}

/* ------- Note ----------- */
Expand Down Expand Up @@ -727,10 +736,7 @@ export class Note extends NotRest {
if (debug) {
console.log(this.stemDirection);
}
if (this.stemDirection === 'noStem') {
vfn.glyphProps.stem = false;
// vfn.render_options.stem_height = 0;
} else {
if (this.stemDirection !== 'noStem') {
// correct VexFlow stem length for notes far from the center line;
let staveDNNSpacing = 5;
if (stave !== undefined) {
Expand Down

0 comments on commit 751d285

Please sign in to comment.