Search in sources :

Example 11 with PitchedInstrument

use of com.xenoage.zong.core.instrument.PitchedInstrument in project Zong by Xenoage.

the class Test72c method testTransposes.

@Test
public void testTransposes() {
    // start instrument
    Part part = score.getStavesList().getParts().get(0);
    PitchedInstrument instrument = (PitchedInstrument) part.getFirstInstrument();
    assertEquals(expectedTransposes[0], instrument.getTranspose());
    // instrument change in measure 1
    InstrumentChange instrChange = score.getMeasure(MP.atMeasure(0, 1)).getInstrumentChanges().get(Companion.get_0());
    instrument = (PitchedInstrument) instrChange.getInstrument();
    assertEquals(expectedTransposes[1], instrument.getTranspose());
}
Also used : InstrumentChange(com.xenoage.zong.core.music.InstrumentChange) Part(com.xenoage.zong.core.music.Part) PitchedInstrument(com.xenoage.zong.core.instrument.PitchedInstrument) Test(org.junit.Test)

Example 12 with PitchedInstrument

use of com.xenoage.zong.core.instrument.PitchedInstrument in project Zong by Xenoage.

the class Test72a method testTransposes.

@Test
public void testTransposes() {
    for (int iPart : range(3)) {
        Part part = score.getStavesList().getParts().get(iPart);
        PitchedInstrument instrument = (PitchedInstrument) part.getFirstInstrument();
        assertEquals("Part " + iPart, expectedTransposes[iPart], instrument.getTranspose());
    }
}
Also used : Part(com.xenoage.zong.core.music.Part) PitchedInstrument(com.xenoage.zong.core.instrument.PitchedInstrument) Test(org.junit.Test)

Aggregations

PitchedInstrument (com.xenoage.zong.core.instrument.PitchedInstrument)12 Part (com.xenoage.zong.core.music.Part)6 Test (org.junit.Test)4 Instrument (com.xenoage.zong.core.instrument.Instrument)3 UnpitchedInstrument (com.xenoage.zong.core.instrument.UnpitchedInstrument)3 lombok.val (lombok.val)3 Score (com.xenoage.zong.core.Score)2 InstrumentChange (com.xenoage.zong.core.music.InstrumentChange)2 MxlMidiInstrument (com.xenoage.zong.musicxml.types.MxlMidiInstrument)2 MxlScoreInstrument (com.xenoage.zong.musicxml.types.MxlScoreInstrument)2 PartAdd (com.xenoage.zong.commands.core.music.PartAdd)1 Transpose (com.xenoage.zong.core.instrument.Transpose)1 Measure (com.xenoage.zong.core.music.Measure)1 Pitch (com.xenoage.zong.core.music.Pitch)1 Clef (com.xenoage.zong.core.music.clef.Clef)1 Key (com.xenoage.zong.core.music.key.Key)1 TraditionalKey (com.xenoage.zong.core.music.key.TraditionalKey)1 TimeSignature (com.xenoage.zong.core.music.time.TimeSignature)1 MP.atMeasure (com.xenoage.zong.core.position.MP.atMeasure)1 DynamicsInterpretation (com.xenoage.zong.io.midi.out.dynamics.DynamicsInterpretation)1