use of com.xenoage.zong.musicxml.types.partwise.MxlMeasure 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);
}
use of com.xenoage.zong.musicxml.types.partwise.MxlMeasure in project Zong by Xenoage.
the class Test01c method test.
@Test
public void test() {
MxlMeasure measure = getFirstMeasure();
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Note) {
// check pitch
MxlNote note = (MxlNote) data;
MxlFullNote fullNote = note.getContent().getFullNote();
MxlPitch pitch = (MxlPitch) (fullNote.getContent());
assertEquals(Companion.pi('G', 0, 4), pitch.getPitch());
// check lyric
assertEquals(1, note.getLyrics().size());
assertEquals("A", ((MxlSyllabicText) note.getLyrics().get(0).getContent()).getText().getValue());
return;
}
}
fail("note not found");
}
Aggregations