Search in sources :

Example 1 with MxlFullNoteContent

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

the class ChordReader method addChordNote.

/**
 * Reads the given note element, which is part of
 * a chord (but not the first note element of the chord), and adds it to the given chord.
 * Also the notations of this note are read.
 */
private static void addChordNote(Context context, MxlNote mxlNote, Chord chord, int staffIndexInPart) {
    // only pitch is interesting for us, since we do not allow
    // different durations for notes within a chord or other strange stuff
    MxlFullNoteContent mxlFNC = mxlNote.getContent().getFullNote().getContent();
    if (mxlFNC.getFullNoteContentType() == MxlFullNoteContentType.Pitch) {
        Pitch pitch = ((MxlPitch) mxlFNC).getPitch();
        Note note = new Note(pitch);
        chord.addNote(note);
        // notations
        if (mxlNote.getNotations() != null) {
            new NotationsReader(mxlNote.getNotations()).readToNote(chord, chord.getNotes().indexOf(note), staffIndexInPart, context);
        }
    }
}
Also used : MxlPitch(com.xenoage.zong.musicxml.types.MxlPitch) MxlNormalNote(com.xenoage.zong.musicxml.types.choice.MxlNormalNote) Note(com.xenoage.zong.core.music.chord.Note) MxlFullNote(com.xenoage.zong.musicxml.types.groups.MxlFullNote) MxlNote(com.xenoage.zong.musicxml.types.MxlNote) MxlCueNote(com.xenoage.zong.musicxml.types.choice.MxlCueNote) MxlGraceNote(com.xenoage.zong.musicxml.types.choice.MxlGraceNote) Pitch(com.xenoage.zong.core.music.Pitch) MxlPitch(com.xenoage.zong.musicxml.types.MxlPitch) MxlFullNoteContent(com.xenoage.zong.musicxml.types.choice.MxlFullNoteContent)

Aggregations

Pitch (com.xenoage.zong.core.music.Pitch)1 Note (com.xenoage.zong.core.music.chord.Note)1 MxlNote (com.xenoage.zong.musicxml.types.MxlNote)1 MxlPitch (com.xenoage.zong.musicxml.types.MxlPitch)1 MxlCueNote (com.xenoage.zong.musicxml.types.choice.MxlCueNote)1 MxlFullNoteContent (com.xenoage.zong.musicxml.types.choice.MxlFullNoteContent)1 MxlGraceNote (com.xenoage.zong.musicxml.types.choice.MxlGraceNote)1 MxlNormalNote (com.xenoage.zong.musicxml.types.choice.MxlNormalNote)1 MxlFullNote (com.xenoage.zong.musicxml.types.groups.MxlFullNote)1