use of com.xenoage.zong.musiclayout.notation.chord.NotesNotation in project Zong by Xenoage.
the class NotesNotatorTest method testChordG4B5.
/**
* Tests a G4-B5, 1/4. Stem: left, down. Width: 1x quarter.
*/
@Test
public void testChordG4B5() {
Chord chord = chord(new Pitch[] { pi(4, 0, 4), pi(6, 0, 5) }, fr(1, 4));
NotesNotation notes = testee.compute(chord, StemDirection.Down, cw, context);
assertEquals(0, notes.stemOffsetIs, Df);
assertEquals(n, notes.widthIs, Df);
assertEquals(0, notes.getNote(0).xIs, Df);
assertEquals(NoteSuspension.None, notes.getNote(0).suspension);
assertEquals(0, notes.getNote(1).xIs, Df);
assertEquals(NoteSuspension.None, notes.getNote(1).suspension);
}
use of com.xenoage.zong.musiclayout.notation.chord.NotesNotation in project Zong by Xenoage.
the class NotesNotatorTest method testChordA4C5D5.
/**
* Tests a A4-C5-D5, 1/4. Stem: left, down. Width: 2x quarter.
*/
@Test
public void testChordA4C5D5() {
Chord chord = chord(new Pitch[] { pi(5, 0, 4), pi(0, 0, 5), pi(1, 0, 5) }, fr(1, 4));
NotesNotation notes = testee.compute(chord, StemDirection.Down, cw, context);
;
assertEquals(n, notes.stemOffsetIs, Df);
assertEquals(2 * n, notes.widthIs, Df);
assertEquals(n, notes.getNote(0).xIs, Df);
assertEquals(NoteSuspension.None, notes.getNote(0).suspension);
assertEquals(0, notes.getNote(1).xIs, Df);
assertEquals(NoteSuspension.Left, notes.getNote(1).suspension);
assertEquals(n, notes.getNote(2).xIs, Df);
assertEquals(NoteSuspension.None, notes.getNote(2).suspension);
}
Aggregations