Search in sources :

Example 6 with Instrument

use of com.xenoage.zong.core.instrument.Instrument 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

Instrument (com.xenoage.zong.core.instrument.Instrument)6 PitchedInstrument (com.xenoage.zong.core.instrument.PitchedInstrument)3 UnpitchedInstrument (com.xenoage.zong.core.instrument.UnpitchedInstrument)3 PartAdd (com.xenoage.zong.commands.core.music.PartAdd)2 Score (com.xenoage.zong.core.Score)2 Part (com.xenoage.zong.core.music.Part)2 Chord (com.xenoage.zong.core.music.chord.Chord)2 MxlMidiInstrument (com.xenoage.zong.musicxml.types.MxlMidiInstrument)2 MxlScoreInstrument (com.xenoage.zong.musicxml.types.MxlScoreInstrument)2 Fraction (com.xenoage.utils.math.Fraction)1 MeasureElementWrite (com.xenoage.zong.commands.core.music.MeasureElementWrite)1 Pitch (com.xenoage.zong.core.music.Pitch)1 Clef (com.xenoage.zong.core.music.clef.Clef)1 Dynamic (com.xenoage.zong.core.music.direction.Dynamic)1 TraditionalKey (com.xenoage.zong.core.music.key.TraditionalKey)1 TimeSignature (com.xenoage.zong.core.music.time.TimeSignature)1 Cursor (com.xenoage.zong.io.selection.Cursor)1 lombok.val (lombok.val)1