Search in sources :

Example 11 with NotesNotation

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);
}
Also used : NotesNotation(com.xenoage.zong.musiclayout.notation.chord.NotesNotation) Chord(com.xenoage.zong.core.music.chord.Chord) Test(org.junit.Test)

Example 12 with NotesNotation

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);
}
Also used : NotesNotation(com.xenoage.zong.musiclayout.notation.chord.NotesNotation) Chord(com.xenoage.zong.core.music.chord.Chord) Test(org.junit.Test)

Aggregations

NotesNotation (com.xenoage.zong.musiclayout.notation.chord.NotesNotation)12 Chord (com.xenoage.zong.core.music.chord.Chord)10 Test (org.junit.Test)8 NoteDisplacement (com.xenoage.zong.musiclayout.notation.chord.NoteDisplacement)5 MusicContext (com.xenoage.zong.core.music.MusicContext)2 StemDirection (com.xenoage.zong.core.music.chord.StemDirection)2 ChordLps (com.xenoage.zong.musiclayout.notation.chord.ChordLps)2 StemNotation (com.xenoage.zong.musiclayout.notation.chord.StemNotation)2 FontInfo (com.xenoage.utils.font.FontInfo)1 TextMeasurer (com.xenoage.utils.font.TextMeasurer)1 Fraction (com.xenoage.utils.math.Fraction)1 Score (com.xenoage.zong.core.Score)1 Pitch (com.xenoage.zong.core.music.Pitch)1 Lyric (com.xenoage.zong.core.music.lyric.Lyric)1 SyllableType (com.xenoage.zong.core.music.lyric.SyllableType)1 FormattedText (com.xenoage.zong.core.text.FormattedText)1 FormattedTextStyle (com.xenoage.zong.core.text.FormattedTextStyle)1 ChordNotation (com.xenoage.zong.musiclayout.notation.ChordNotation)1 AccidentalsNotation (com.xenoage.zong.musiclayout.notation.chord.AccidentalsNotation)1 ArticulationsNotation (com.xenoage.zong.musiclayout.notation.chord.ArticulationsNotation)1