Search in sources :

Example 6 with MP

use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.

the class ScoreTest method testMeasureElements.

private static <T> void testMeasureElements(List<Tuple2<MP, T>> expectedElements, Score score, BiFunction<Measure, Fraction, T> getElementAtBeat) {
    for (Tuple2<MP, T> expectedElement : expectedElements) {
        MP mp = expectedElement.get1();
        Measure measure = score.getMeasure(mp);
        T element = getElementAtBeat.apply(measure, mp.beat);
        assertNotNull("" + mp, element);
        assertEquals("" + mp, expectedElement.get2(), element);
    }
}
Also used : MP(com.xenoage.zong.core.position.MP) Measure(com.xenoage.zong.core.music.Measure)

Example 7 with MP

use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.

the class ScoreTest method testColumnElements.

private static <T> void testColumnElements(List<Tuple2<MP, T>> expectedElements, Score score, BiFunction<ColumnHeader, Fraction, T> getElementAtBeat) {
    for (Tuple2<MP, T> expectedElement : expectedElements) {
        MP mp = expectedElement.get1();
        ColumnHeader columnHeader = score.getColumnHeader(mp.measure);
        T element = getElementAtBeat.apply(columnHeader, mp.beat);
        assertNotNull("" + mp, element);
        assertEquals("" + mp, expectedElement.get2(), element);
    }
}
Also used : ColumnHeader(com.xenoage.zong.core.header.ColumnHeader) MP(com.xenoage.zong.core.position.MP)

Example 8 with MP

use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.

the class Test61c method test.

@Test
public void test() {
    for (int iStaff : range(2)) {
        for (int iElement : range(4)) {
            MP mp = MP.atElement(iStaff, 0, 0, iElement);
            Chord chord = ChordTest.getChordAt(score, mp);
            assertEqualsChordLyrics(expectedLyrics[iStaff][iElement], chord, mp);
        }
    }
}
Also used : MP(com.xenoage.zong.core.position.MP) Chord(com.xenoage.zong.core.music.chord.Chord) ChordTest(musicxmltestsuite.tests.utils.ChordTest) Test(org.junit.Test)

Example 9 with MP

use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.

the class Test61d method test.

@Test
public void test() {
    for (int iMeasure : range(2)) {
        for (int iElement : range(4)) {
            MP mp = MP.atElement(0, iMeasure, 0, iElement);
            Chord chord = ChordTest.getChordAt(score, mp);
            assertEqualsChordLyrics(expectedLyrics[iMeasure * 4 + iElement], chord, mp);
        }
    }
}
Also used : MP(com.xenoage.zong.core.position.MP) Chord(com.xenoage.zong.core.music.chord.Chord) ChordTest(musicxmltestsuite.tests.utils.ChordTest) Test(org.junit.Test)

Example 10 with MP

use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.

the class Test61i method test.

@Test
public void test() {
    MP mp = MP.atElement(0, 0, 0, 0);
    Chord chord = ChordTest.getChordAt(score, mp);
    assertEquals(expectedChordNotesCount[0], chord.getNotes().size());
    assertEqualsChordLyrics(expectedLyrics[0], chord, mp);
}
Also used : MP(com.xenoage.zong.core.position.MP) Chord(com.xenoage.zong.core.music.chord.Chord) ChordTest(musicxmltestsuite.tests.utils.ChordTest) Test(org.junit.Test)

Aggregations

MP (com.xenoage.zong.core.position.MP)46 Test (org.junit.Test)30 Score (com.xenoage.zong.core.Score)19 Chord (com.xenoage.zong.core.music.chord.Chord)16 Voice (com.xenoage.zong.core.music.Voice)14 Rest (com.xenoage.zong.core.music.rest.Rest)11 ChordTest (musicxmltestsuite.tests.utils.ChordTest)6 Pitch (com.xenoage.zong.core.music.Pitch)4 Measure (com.xenoage.zong.core.music.Measure)3 Direction (com.xenoage.zong.core.music.direction.Direction)3 MP.atVoice (com.xenoage.zong.core.position.MP.atVoice)3 VoiceTest.assertEqualsVoice (musicxmltestsuite.tests.utils.VoiceTest.assertEqualsVoice)3 MeasureElementWrite (com.xenoage.zong.commands.core.music.MeasureElementWrite)2 VoiceElementWrite (com.xenoage.zong.commands.core.music.VoiceElementWrite)2 ColumnHeader (com.xenoage.zong.core.header.ColumnHeader)2 Staff (com.xenoage.zong.core.music.Staff)2 Beam (com.xenoage.zong.core.music.beam.Beam)2 Tempo (com.xenoage.zong.core.music.direction.Tempo)2 Position (com.xenoage.zong.core.music.format.Position)2 TraditionalKey (com.xenoage.zong.core.music.key.TraditionalKey)2