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();
}
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);
}
Aggregations