Skip to content

Commit

Permalink
Merge pull request #259 from cuthbertLab/whole-note-stems
Browse files Browse the repository at this point in the history
Augmented Second Chord Stems
  • Loading branch information
mscuthbert authored Jun 22, 2024
2 parents 6ab57ab + a46f5e7 commit 356cbfd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/stream/makeNotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ export function setStemDirectionForUnspecified(
}

for (const n of s.rc(note.NotRest)) {
if (n.pitches.length > 1) {
const pitchSet = new Set(n.pitches.map(p => p.diatonicNoteNum));
if (pitchSet.size < n.pitches.length) {
// bug in Vexflow v4 at least -- chords with augmented seconds
// and down stems do no render properly.
// set their stems to 'unspecified' which Vexflow will currently
// render as upstems.
n.stemDirection = 'unspecified';
continue;
}
}

if (n.stemDirection !== 'unspecified') {
continue;
}
Expand All @@ -202,6 +214,9 @@ export function setStemDirectionForUnspecified(
const _up_down: readonly string[] = ['up', 'down'];
const _up_down_unspecified: readonly string[] = ['up', 'down', 'unspecified'];

/**
* Set stem directions for all notes in a beam group.
*/
export function setStemDirectionOneGroup(
group: note.NotRest[],
{
Expand Down

0 comments on commit 356cbfd

Please sign in to comment.