Search in sources :

Example 11 with MxlPart

use of com.xenoage.zong.musicxml.types.partwise.MxlPart in project Zong by Xenoage.

the class MxlScorePartwise method write.

public void write(XmlWriter writer) {
    writer.writeElementStart(elemName);
    writer.writeAttribute("version", version);
    scoreHeader.write(writer);
    for (MxlPart part : parts) {
        writeSeparatorComment(writer);
        part.write(writer);
    }
    writeSeparatorComment(writer);
    writer.writeElementEnd();
}
Also used : MxlPart(com.xenoage.zong.musicxml.types.partwise.MxlPart)

Example 12 with MxlPart

use of com.xenoage.zong.musicxml.types.partwise.MxlPart in project Zong by Xenoage.

the class Test01a method test.

@ToDo("the editiorial sharp (sharp in parenthesis) in the last measure is not supported yet")
@Test
public void test() {
    Pitch[] expectedPitches = getExpectedPitches();
    MxlPart part = getFirstPart();
    assertEquals(26, part.getMeasures().size());
    int iPitch = 0;
    for (int iM = 0; iM < part.getMeasures().size(); iM++) {
        MxlMeasure measure = part.getMeasures().get(iM);
        for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
            if (data.getMusicDataContentType() == MxlMusicDataContentType.Note) {
                // check note and pitch
                MxlFullNote note = ((MxlNote) data).getContent().getFullNote();
                MxlPitch pitch = (MxlPitch) (note.getContent());
                assertEquals("note " + iPitch, expectedPitches[iPitch++], pitch.getPitch());
            }
        }
    }
    assertEquals("not all notes found", expectedPitches.length, iPitch);
}
Also used : MxlMusicDataContent(com.xenoage.zong.musicxml.types.choice.MxlMusicDataContent) MxlFullNote(com.xenoage.zong.musicxml.types.groups.MxlFullNote) MxlPitch(com.xenoage.zong.musicxml.types.MxlPitch) MxlPitch(com.xenoage.zong.musicxml.types.MxlPitch) Pitch(com.xenoage.zong.core.music.Pitch) MxlPart(com.xenoage.zong.musicxml.types.partwise.MxlPart) MxlMeasure(com.xenoage.zong.musicxml.types.partwise.MxlMeasure) ToDo(musicxmltestsuite.tests.utils.ToDo) Test(org.junit.Test)

Aggregations

MxlPart (com.xenoage.zong.musicxml.types.partwise.MxlPart)12 MxlMeasure (com.xenoage.zong.musicxml.types.partwise.MxlMeasure)10 MxlMusicDataContent (com.xenoage.zong.musicxml.types.choice.MxlMusicDataContent)9 Test (org.junit.Test)8 ToDo (musicxmltestsuite.tests.utils.ToDo)4 TraditionalKey (com.xenoage.zong.core.music.key.TraditionalKey)3 MxlAttributes (com.xenoage.zong.musicxml.types.MxlAttributes)3 Pitch (com.xenoage.zong.core.music.Pitch)2 MxlKey (com.xenoage.zong.musicxml.types.MxlKey)2 MxlPitch (com.xenoage.zong.musicxml.types.MxlPitch)2 MxlNormalNote (com.xenoage.zong.musicxml.types.choice.MxlNormalNote)2 MxlFullNote (com.xenoage.zong.musicxml.types.groups.MxlFullNote)2 NonNull (com.xenoage.utils.annotations.NonNull)1 Tuple2 (com.xenoage.utils.kernel.Tuple2)1 Fraction (com.xenoage.utils.math.Fraction)1 ColumnElementWrite (com.xenoage.zong.commands.core.music.ColumnElementWrite)1 MeasureAddUpTo (com.xenoage.zong.commands.core.music.MeasureAddUpTo)1 MeasureElementWrite (com.xenoage.zong.commands.core.music.MeasureElementWrite)1 VoiceElementWrite (com.xenoage.zong.commands.core.music.VoiceElementWrite)1 Measure (com.xenoage.zong.core.music.Measure)1