Search in sources :

Example 1 with MxlLyricContentType

use of com.xenoage.zong.musicxml.types.choice.MxlLyricContent.MxlLyricContentType in project Zong by Xenoage.

the class LyricReader method readLyrics.

private List<Lyric> readLyrics() {
    // not supported yet: in MusicXML also rests can have lyrics. see measure 36 in Echigo-Jishi
    List<Lyric> ret = alist();
    for (MxlNote mxlNote : mxlNotes) {
        for (MxlLyric mxlLyric : it(mxlNote.getLyrics())) {
            int verse = readVerse(mxlLyric);
            MxlLyricContentType mxlLCType = mxlLyric.getContent().getLyricContentType();
            if (mxlLCType == MxlLyricContentType.SyllabicText) {
                MxlSyllabicText mxlSyllabicText = (MxlSyllabicText) mxlLyric.getContent();
                SyllableType syllableType = readSyllableType(mxlLyric);
                // the next element must be the text element
                ret.add(new Lyric(Companion.ut(mxlSyllabicText.getText().getValue()), syllableType, verse));
            } else if (mxlLCType == MxlLyricContentType.Extend) {
                // extend - TODO: extension to next chord!
                ret.add(Lyric.Companion.lyricExtend(verse));
            }
        }
    }
    return ret;
}
Also used : MxlLyric(com.xenoage.zong.musicxml.types.MxlLyric) MxlLyric(com.xenoage.zong.musicxml.types.MxlLyric) Lyric(com.xenoage.zong.core.music.lyric.Lyric) SyllableType(com.xenoage.zong.core.music.lyric.SyllableType) MxlSyllabicText(com.xenoage.zong.musicxml.types.MxlSyllabicText) MxlNote(com.xenoage.zong.musicxml.types.MxlNote) MxlLyricContentType(com.xenoage.zong.musicxml.types.choice.MxlLyricContent.MxlLyricContentType)

Aggregations

Lyric (com.xenoage.zong.core.music.lyric.Lyric)1 SyllableType (com.xenoage.zong.core.music.lyric.SyllableType)1 MxlLyric (com.xenoage.zong.musicxml.types.MxlLyric)1 MxlNote (com.xenoage.zong.musicxml.types.MxlNote)1 MxlSyllabicText (com.xenoage.zong.musicxml.types.MxlSyllabicText)1 MxlLyricContentType (com.xenoage.zong.musicxml.types.choice.MxlLyricContent.MxlLyricContentType)1