Skip to content

Commit

Permalink
added support for accent articulations in easyscore
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew13648 committed Apr 29, 2020
1 parent f4753d3 commit 23d3ee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/articulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export class Articulation extends Modifier {
const articNameToCode = {
staccato: 'a.',
tenuto: 'a-',
accent: 'a>'
};

articulations
Expand Down
7 changes: 5 additions & 2 deletions tests/easyscore_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Vex.Flow.Test.EasyScore = (function() {
const score = vf.EasyScore();
const system = vf.System();

const notes = score.notes('B4/h[id="foobar", class="red,bold", stem="up", articulations="staccato.below,tenuto"], B4/h[stem="down"]');
const notes = score.notes('B4/h[id="foobar", class="red,bold", stem="up", articulations="staccato.below,tenuto"], B4/q[articulations="accent.above"], B4/q[stem="down"]');

system.addStave({
voices: [score.voice(notes)],
Expand All @@ -244,7 +244,10 @@ Vex.Flow.Test.EasyScore = (function() {
assert.equal(notes[0].modifiers[1].type, 'a-');
assert.equal(notes[0].modifiers[1].position, VF.Modifier.Position.ABOVE);
assert.equal(notes[0].getStemDirection(), VF.StaveNote.STEM_UP);
assert.equal(notes[1].getStemDirection(), VF.StaveNote.STEM_DOWN);
assert.equal(notes[1].modifiers[0].getCategory(), 'articulations');
assert.equal(notes[1].modifiers[0].type, 'a>');
assert.equal(notes[1].modifiers[0].position, VF.Modifier.Position.ABOVE);
assert.equal(notes[2].getStemDirection(), VF.StaveNote.STEM_DOWN);
},
};

Expand Down

0 comments on commit 23d3ee0

Please sign in to comment.