Search in sources :

Example 96 with Score

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

the class Test32b method testFontSize.

@Test
public void testFontSize() {
    Score score = getScore();
    // in the following pairs of words, the left words has smaller font size
    // than the right words
    int[][] indexPairs = { // medium, large
    { 1, 2 }, // small, medium
    { 4, 0 } };
    for (int[] indexPair : indexPairs) {
        float size1 = getFontSize(score, indexPair[0]);
        float size2 = getFontSize(score, indexPair[1]);
        assertTrue(size1 < size2);
    }
}
Also used : Score(com.xenoage.zong.core.Score) Test(org.junit.Test)

Example 97 with Score

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

the class Test41a method test.

@Test
public void test() {
    Score score = getScore();
    StavesList stavesList = score.getStavesList();
    List<Part> parts = stavesList.getParts();
    assertEquals(expectedNames.length, parts.size());
    for (int i : range(parts)) {
        assertEquals(expectedNames[i], parts.get(i).getName());
        int firstStaffIndex = stavesList.getPartStaffIndices(parts.get(i)).getStart();
        assertEquals(expectedPitches[i], getFirstPitch(score, firstStaffIndex));
    }
}
Also used : Score(com.xenoage.zong.core.Score) Part(com.xenoage.zong.core.music.Part) StavesList(com.xenoage.zong.core.music.StavesList) Test(org.junit.Test)

Example 98 with Score

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

the class Test41f method test.

@Test
public void test() {
    Score score = getScore();
    StavesList stavesList = score.getStavesList();
    StavesListTest.checkBracketGroups(stavesList, expectedBracketGroups);
    StavesListTest.checkBarlineGroups(stavesList, expectedBarlineGroups);
}
Also used : Score(com.xenoage.zong.core.Score) StavesList(com.xenoage.zong.core.music.StavesList) Test(org.junit.Test) StavesListTest(musicxmltestsuite.tests.utils.StavesListTest)

Example 99 with Score

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

the class Test12a method test.

@Test
public void test() {
    Score score = getScore();
    // check clefs and line position of c4
    int m = 0;
    checkClef(score, m++, ClefSymbol.G, 2, -2);
    checkClef(score, m++, ClefSymbol.C, 4, 4);
    checkClef(score, m++, ClefSymbol.C, 6, 6);
    checkClef(score, m++, ClefSymbol.F, 6, 10);
    // in Zong!, we use Perc = Treble
    checkClef(score, m++, ClefSymbol.PercTwoRects, 4, -2);
    checkClef(score, m++, ClefSymbol.G8vb, 2, 5);
    checkClef(score, m++, ClefSymbol.F8vb, 6, 17);
    checkClef(score, m++, ClefSymbol.F, 4, 8);
    checkClef(score, m++, ClefSymbol.G, 0, -4);
    checkClef(score, m++, ClefSymbol.C, 8, 8);
    checkClef(score, m++, ClefSymbol.C, 2, 2);
    checkClef(score, m++, ClefSymbol.C, 0, 0);
    // in Zong!, we use Perc = Treble
    checkClef(score, m++, ClefSymbol.PercTwoRects, 4, -2);
    checkClef(score, m++, ClefSymbol.G8va, 2, -9);
    checkClef(score, m++, ClefSymbol.F8va, 6, 3);
    // in Zong!, we use Tab = Treble
    checkClef(score, m++, ClefSymbol.Tab, 4, -2);
    // in Zong!, we use None = Treble
    checkClef(score, m++, ClefSymbol.None, 4, -2);
    checkClef(score, m++, ClefSymbol.G, 2, -2);
}
Also used : Score(com.xenoage.zong.core.Score) Test(org.junit.Test)

Aggregations

Score (com.xenoage.zong.core.Score)99 Test (org.junit.Test)62 Rest (com.xenoage.zong.core.music.rest.Rest)22 MP (com.xenoage.zong.core.position.MP)19 Voice (com.xenoage.zong.core.music.Voice)15 Cursor (com.xenoage.zong.io.selection.Cursor)15 TimeSignature (com.xenoage.zong.core.music.time.TimeSignature)14 Chord (com.xenoage.zong.core.music.chord.Chord)11 StavesList (com.xenoage.zong.core.music.StavesList)9 MusicXmlScoreFileInputTest (com.xenoage.zong.io.musicxml.in.MusicXmlScoreFileInputTest)9 Part (com.xenoage.zong.core.music.Part)8 ColumnHeader (com.xenoage.zong.core.header.ColumnHeader)7 lombok.val (lombok.val)7 TraditionalKey (com.xenoage.zong.core.music.key.TraditionalKey)6 Direction (com.xenoage.zong.core.music.direction.Direction)5 Dynamic (com.xenoage.zong.core.music.direction.Dynamic)5 Size2f (com.xenoage.utils.math.geom.Size2f)4 PartAdd (com.xenoage.zong.commands.core.music.PartAdd)4 ScoreFormat (com.xenoage.zong.core.format.ScoreFormat)4 ScoreHeader (com.xenoage.zong.core.header.ScoreHeader)4