Search in sources :

Example 1 with MxlScoreInstrument

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

the class InstrumentsReader method readScoreInstruments.

private void readScoreInstruments() {
    for (MxlScoreInstrument mxlScoreInstr : mxlScorePart.getScoreInstruments()) {
        String id = mxlScoreInstr.getId();
        Info info = new Info();
        info.id = id;
        info.name = checkNotNull(mxlScoreInstr.getInstrumentName());
        info.abbreviation = mxlScoreInstr.getInstrumentAbbreviation();
        infos.put(id, info);
    }
}
Also used : MxlScoreInstrument(com.xenoage.zong.musicxml.types.MxlScoreInstrument)

Example 2 with MxlScoreInstrument

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

the class InstrumentsReader method createInstruments.

private List<Instrument> createInstruments() {
    List<Instrument> ret = alist();
    for (MxlScoreInstrument mxlScoreInstr : mxlScorePart.getScoreInstruments()) {
        Instrument instrument = readInstrument(getInfo(mxlScoreInstr.getId()));
        ret.add(instrument);
    }
    // a default instrument with this transposition
    if (ret.size() == 0 && partTranspose != Transpose.Companion.getNoTranspose()) {
        PitchedInstrument instrument = new PitchedInstrument(mxlPart.getId(), 0);
        instrument.setTranspose(partTranspose);
        ret.add(instrument);
    }
    return ret;
}
Also used : MxlScoreInstrument(com.xenoage.zong.musicxml.types.MxlScoreInstrument) PitchedInstrument(com.xenoage.zong.core.instrument.PitchedInstrument) UnpitchedInstrument(com.xenoage.zong.core.instrument.UnpitchedInstrument) MxlMidiInstrument(com.xenoage.zong.musicxml.types.MxlMidiInstrument) PitchedInstrument(com.xenoage.zong.core.instrument.PitchedInstrument) Instrument(com.xenoage.zong.core.instrument.Instrument) MxlScoreInstrument(com.xenoage.zong.musicxml.types.MxlScoreInstrument)

Aggregations

MxlScoreInstrument (com.xenoage.zong.musicxml.types.MxlScoreInstrument)2 Instrument (com.xenoage.zong.core.instrument.Instrument)1 PitchedInstrument (com.xenoage.zong.core.instrument.PitchedInstrument)1 UnpitchedInstrument (com.xenoage.zong.core.instrument.UnpitchedInstrument)1 MxlMidiInstrument (com.xenoage.zong.musicxml.types.MxlMidiInstrument)1