Search in sources :

Example 1 with Fermata

use of com.xenoage.zong.core.music.annotation.Fermata in project Zong by Xenoage.

the class FermataReader method read.

public static Fermata read(MxlFermata mxlFermata, StaffDetails staffDetails) {
    // determine position
    Positioning positioning = new PositioningReader(staffDetails).readFromAny(mxlFermata);
    if (positioning == null) {
        if (mxlFermata.getType() == MxlUprightInverted.Upright)
            positioning = Placement.Above;
        else if (mxlFermata.getType() == MxlUprightInverted.Inverted)
            positioning = Placement.Below;
    }
    Fermata fermata = new Fermata();
    fermata.setPositioning(positioning);
    return fermata;
}
Also used : Positioning(com.xenoage.zong.core.music.format.Positioning) MxlFermata(com.xenoage.zong.musicxml.types.MxlFermata) Fermata(com.xenoage.zong.core.music.annotation.Fermata)

Example 2 with Fermata

use of com.xenoage.zong.core.music.annotation.Fermata in project Zong by Xenoage.

the class NotationsReader method readToNote.

public void readToNote(Chord chord, int noteIndex, int staffIndexInPart, Context context) {
    StaffDetails staffDetails = StaffDetails.fromContext(context, staffIndexInPart);
    ArrayList<Annotation> annotations = alist(0);
    for (MxlNotations mxlNotationsElement : mxlNotations) {
        for (MxlNotationsContent mxlNC : mxlNotationsElement.getElements()) {
            MxlNotationsContentType mxlNCType = mxlNC.getNotationsContentType();
            switch(mxlNCType) {
                case SlurOrTied:
                    {
                        SlurReader.readToContext(chord, noteIndex, staffIndexInPart, context, (MxlSlurOrTied) mxlNC);
                        break;
                    }
                case Dynamics:
                    {
                        Dynamic dynamics = DynamicsReader.read((MxlDynamics) mxlNC, staffDetails);
                        new DirectionAdd(dynamics, chord).execute();
                        break;
                    }
                case Articulations:
                    {
                        MxlArticulations mxlArticulations = (MxlArticulations) mxlNC;
                        annotations.addAll(ArticulationReader.read(mxlArticulations));
                        break;
                    }
                case Fermata:
                    {
                        Fermata fermata = FermataReader.read((MxlFermata) mxlNC, staffDetails);
                        annotations.add(fermata);
                        break;
                    }
                case Ornaments:
                    {
                        MxlOrnaments mxlOrnaments = (MxlOrnaments) mxlNC;
                        annotations.addAll(OrnamentReader.read(mxlOrnaments));
                        break;
                    }
                default:
            }
        }
    }
    if (annotations.size() > 0)
        chord.setAnnotations(annotations);
}
Also used : Dynamic(com.xenoage.zong.core.music.direction.Dynamic) MxlFermata(com.xenoage.zong.musicxml.types.MxlFermata) MxlDynamics(com.xenoage.zong.musicxml.types.MxlDynamics) MxlSlurOrTied(com.xenoage.zong.musicxml.types.MxlSlurOrTied) Annotation(com.xenoage.zong.core.music.annotation.Annotation) MxlNotationsContent(com.xenoage.zong.musicxml.types.choice.MxlNotationsContent) Fermata(com.xenoage.zong.core.music.annotation.Fermata) MxlFermata(com.xenoage.zong.musicxml.types.MxlFermata) DirectionAdd(com.xenoage.zong.commands.core.music.direction.DirectionAdd) MxlNotations(com.xenoage.zong.musicxml.types.MxlNotations) MxlArticulations(com.xenoage.zong.musicxml.types.MxlArticulations) StaffDetails(com.xenoage.zong.io.musicxml.in.util.StaffDetails) MxlOrnaments(com.xenoage.zong.musicxml.types.MxlOrnaments) MxlNotationsContentType(com.xenoage.zong.musicxml.types.choice.MxlNotationsContent.MxlNotationsContentType)

Example 3 with Fermata

use of com.xenoage.zong.core.music.annotation.Fermata in project Zong by Xenoage.

the class Utils method fermata.

public static Fermata fermata(Positioning positioning) {
    Fermata ret = new Fermata();
    ret.setPositioning(positioning);
    return ret;
}
Also used : Fermata(com.xenoage.zong.core.music.annotation.Fermata)

Aggregations

Fermata (com.xenoage.zong.core.music.annotation.Fermata)3 MxlFermata (com.xenoage.zong.musicxml.types.MxlFermata)2 DirectionAdd (com.xenoage.zong.commands.core.music.direction.DirectionAdd)1 Annotation (com.xenoage.zong.core.music.annotation.Annotation)1 Dynamic (com.xenoage.zong.core.music.direction.Dynamic)1 Positioning (com.xenoage.zong.core.music.format.Positioning)1 StaffDetails (com.xenoage.zong.io.musicxml.in.util.StaffDetails)1 MxlArticulations (com.xenoage.zong.musicxml.types.MxlArticulations)1 MxlDynamics (com.xenoage.zong.musicxml.types.MxlDynamics)1 MxlNotations (com.xenoage.zong.musicxml.types.MxlNotations)1 MxlOrnaments (com.xenoage.zong.musicxml.types.MxlOrnaments)1 MxlSlurOrTied (com.xenoage.zong.musicxml.types.MxlSlurOrTied)1 MxlNotationsContent (com.xenoage.zong.musicxml.types.choice.MxlNotationsContent)1 MxlNotationsContentType (com.xenoage.zong.musicxml.types.choice.MxlNotationsContent.MxlNotationsContentType)1