Search in sources :

Example 6 with ClefType

use of com.xenoage.zong.core.music.clef.ClefType in project Zong by Xenoage.

the class ClefReader method read.

public Clef read() {
    if (mxlClef == null)
        return null;
    ClefType clefType = readType();
    Clef clef = (clefType != null ? new Clef(clefType) : null);
    return clef;
}
Also used : ClefType(com.xenoage.zong.core.music.clef.ClefType) Clef(com.xenoage.zong.core.music.clef.Clef) MxlClef(com.xenoage.zong.musicxml.types.MxlClef)

Example 7 with ClefType

use of com.xenoage.zong.core.music.clef.ClefType in project Zong by Xenoage.

the class ClefReader method readLine.

private void readLine() {
    // read line or use default position
    Integer line = mxlClef.getLine();
    if (line == null) {
        clefType = ClefType.Companion.getCommonClefs().get(symbol);
    } else {
        // convert MusicXML line number (1 based) to LP (0 based)
        int lp = (line - 1) * 2;
        // in Zong!, it is centered, so move it 2 interline spaces down (= 4 LPs)
        if (symbol == ClefSymbol.Tab || symbol == ClefSymbol.TabSmall)
            lp -= 4;
        clefType = new ClefType(symbol, lp);
    }
}
Also used : ClefType(com.xenoage.zong.core.music.clef.ClefType)

Example 8 with ClefType

use of com.xenoage.zong.core.music.clef.ClefType in project Zong by Xenoage.

the class Base46c method getExpectedClefs.

static List<Tuple2<MP, Clef>> getExpectedClefs() {
    List<Tuple2<MP, Clef>> clefs = alist();
    clefs.add(t(atBeat(0, 0, unknown, Companion.get_0()), new Clef(ClefType.Companion.getClefTreble())));
    clefs.add(t(atBeat(0, 2, unknown, Companion.get_0()), new Clef(new ClefType(ClefSymbol.C, 2))));
    clefs.add(t(atBeat(0, 3, unknown, Companion.fr(2, 4)), new Clef(ClefType.Companion.getClefTreble())));
    return clefs;
}
Also used : Tuple2(com.xenoage.utils.kernel.Tuple2) Clef(com.xenoage.zong.core.music.clef.Clef) ClefType(com.xenoage.zong.core.music.clef.ClefType)

Aggregations

ClefType (com.xenoage.zong.core.music.clef.ClefType)8 Clef (com.xenoage.zong.core.music.clef.Clef)4 Tuple2 (com.xenoage.utils.kernel.Tuple2)2 Key (com.xenoage.zong.core.music.key.Key)1 TraditionalKey (com.xenoage.zong.core.music.key.TraditionalKey)1 TraditionalKeyNotation (com.xenoage.zong.musiclayout.notation.TraditionalKeyNotation)1 ElementWidth (com.xenoage.zong.musiclayout.spacing.ElementWidth)1 StaffSymbolStamping (com.xenoage.zong.musiclayout.stampings.StaffSymbolStamping)1 MxlClef (com.xenoage.zong.musicxml.types.MxlClef)1 lombok.val (lombok.val)1