MidiCompiler.java

1
package com.github.dakusui.symfonion.core;
2
3
import com.github.dakusui.logias.Logias;
4
import com.github.dakusui.logias.lisp.Context;
5
import com.github.dakusui.logias.lisp.s.Literal;
6
import com.github.dakusui.logias.lisp.s.Sexp;
7
import com.github.dakusui.symfonion.exceptions.ExceptionThrower;
8
import com.github.dakusui.symfonion.utils.Fraction;
9
import com.github.dakusui.symfonion.exceptions.SymfonionException;
10
import com.github.dakusui.symfonion.utils.Utils;
11
import com.github.dakusui.symfonion.song.*;
12
import com.github.dakusui.symfonion.song.Pattern.Parameters;
13
import com.google.gson.JsonArray;
14
15
import javax.sound.midi.*;
16
import java.io.ByteArrayOutputStream;
17
import java.io.IOException;
18
import java.util.HashMap;
19
import java.util.Iterator;
20
import java.util.List;
21
import java.util.Map;
22
23
import static com.github.dakusui.symfonion.exceptions.ExceptionThrower.*;
24
import static com.github.dakusui.symfonion.exceptions.ExceptionThrower.ContextKey.JSON_ELEMENT_ROOT;
25
26
public class MidiCompiler {
27
28
  private final Context logiasContext;
29
30
  public MidiCompiler(Context logiasContext) {
31
    this.logiasContext = (logiasContext);
32
  }
33
34
  /**
35
   * Compiles a {@link Song} object into a map from a port name to {@link Sequence} object.
36
   *
37
   * @param song An object that holds user-provided music data.
38
   * @return A map from a port name to {@code Sequence} object.
39
   * @throws InvalidMidiDataException Won't be thrown.
40
   * @throws SymfonionException       Undefined part name is referenced by a bar.
41
   */
42
  public Map<String, Sequence> compile(Song song) throws InvalidMidiDataException, SymfonionException {
43 1 1. compile : removed call to java/io/PrintStream::println → SURVIVED
    System.err.println("Now compiling...");
44
    int resolution = 384;
45
    Map<String, Sequence> ret = new HashMap<>();
46
    Map<String, Track> tracks;
47
    tracks = new HashMap<>();
48
    for (String partName : song.partNames()) {
49
      Part part = song.part(partName);
50
      String portName = part.portName();
51
      Sequence sequence = ret.get(portName);
52 1 1. compile : negated conditional → KILLED
      if (sequence == null) {
53 1 1. compile : Replaced integer division with multiplication → SURVIVED
        sequence = new Sequence(Sequence.PPQ, resolution / 4);
54
        ret.put(portName, sequence);
55
      }
56
      tracks.put(partName, sequence.createTrack());
57
    }
58
59
    ////
60
    // position is the offset of a bar from the beginning of the sequence.
61
    // Giving the sequencer a grace period to initialize its internal state.
62
    long barPositionInTicks = 0; //= resolution / 4;
63
    int barid = 0;
64
    for (Bar bar : song.bars()) {
65
      try (var ignored = context($(JSON_ELEMENT_ROOT, bar.rootJsonObject()))) {
66 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::barStarted → SURVIVED
        barStarted(barid);
67
        Groove groove = bar.groove();
68
        for (String partName : bar.partNames()) {
69 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partStarted → SURVIVED
          partStarted(partName);
70
          Track track = tracks.get(partName);
71 1 1. compile : negated conditional → KILLED
          if (track == null) {
72 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::aborted → SURVIVED
            aborted();
73
            throw partNotFound(bar.lookUpJsonNode(partName), partName);
74
          }
75
          int channel = song.part(partName).channel();
76
          for (List<Pattern> patterns : bar.part(partName)) {
77
            ////
78
            // relativePosition is a relative position from the beginning
79
            // of the bar the pattern belongs to.
80
            Fraction relPosInBar = Fraction.zero;
81
            for (Pattern each : patterns) {
82
              Parameters params = each.parameters();
83 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::patternStarted → SURVIVED
              patternStarted();
84
              for (Stroke stroke : each.strokes()) {
85
                try {
86
                  Fraction endingPos = Fraction.add(relPosInBar, stroke.length());
87
88 1 1. compile : removed call to com/github/dakusui/symfonion/song/Stroke::compile → KILLED
                  stroke.compile(
89
                      this,
90
                      new MidiCompilerContext(
91
                          track,
92
                          channel,
93
                          params,
94
                          relPosInBar,
95
                          barPositionInTicks,
96
                          groove
97
                      )
98
                  );
99
100
                  relPosInBar = endingPos;
101
                  ////
102
                  // Breaks if relative position goes over the length of the bar.
103 2 1. compile : changed conditional boundary → SURVIVED
2. compile : negated conditional → KILLED
                  if (Fraction.compare(relPosInBar, bar.beats()) >= 0) {
104
                    break;
105
                  }
106
                } finally {
107 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::strokeEnded → SURVIVED
                  strokeEnded();
108
                }
109
              }
110 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::patternEnded → SURVIVED
              patternEnded();
111
            }
112
          }
113 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partEnded → SURVIVED
          partEnded();
114
        }
115 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::barEnded → SURVIVED
        barEnded();
116 1 1. compile : Changed increment from 1 to -1 → SURVIVED
        barid++;
117 2 1. compile : Replaced double multiplication with division → SURVIVED
2. compile : Replaced long addition with subtraction → SURVIVED
        barPositionInTicks += (long) (bar.beats().doubleValue() * resolution);
118
      }
119
    }
120 1 1. compile : removed call to java/io/PrintStream::println → SURVIVED
    System.err.println("Compilation finished.");
121 1 1. compile : replaced return value with Collections.emptyMap for com/github/dakusui/symfonion/core/MidiCompiler::compile → KILLED
    return ret;
122
  }
123
124
  public MidiEvent createNoteOnEvent(int ch, int nKey, int velocity, long lTick) throws InvalidMidiDataException {
125 1 1. createNoteOnEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOnEvent → KILLED
    return createNoteEvent(ShortMessage.NOTE_ON,
126
        ch,
127
        nKey,
128
        velocity,
129
        lTick);
130
  }
131
132
  public MidiEvent createNoteOffEvent(int ch, int nKey, long lTick) throws InvalidMidiDataException {
133 1 1. createNoteOffEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOffEvent → KILLED
    return createNoteEvent(ShortMessage.NOTE_OFF,
134
        ch,
135
        nKey,
136
        0,
137
        lTick);
138
  }
139
140
  protected MidiEvent createNoteEvent(int nCommand,
141
                                      int ch,
142
                                      int nKey,
143
                                      int nVelocity,
144
                                      long lTick) throws InvalidMidiDataException {
145
    ShortMessage message = new ShortMessage();
146 1 1. createNoteEvent : removed call to javax/sound/midi/ShortMessage::setMessage → KILLED
    message.setMessage(nCommand,
147
        ch,
148
        nKey,
149
        nVelocity);
150 1 1. createNoteEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteEvent → KILLED
    return new MidiEvent(message,
151
        lTick);
152
  }
153
154
  public MidiEvent createProgramChangeEvent(int ch, int pgnum, long lTick) throws InvalidMidiDataException {
155
    ShortMessage message = new ShortMessage();
156 1 1. createProgramChangeEvent : removed call to javax/sound/midi/ShortMessage::setMessage → KILLED
    message.setMessage(ShortMessage.PROGRAM_CHANGE, ch, pgnum, 0);
157
158 1 1. createProgramChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createProgramChangeEvent → KILLED
    return new MidiEvent(message, lTick);
159
  }
160
161
  public MidiEvent createSysexEvent(int ch, JsonArray arr, long lTick) throws InvalidMidiDataException {
162
    SysexMessage message = new SysexMessage();
163
    Context lctxt = this.logiasContext.createChild();
164
    Sexp channel = new Literal(ch);
165
    lctxt.bind("channel", channel);
166
    Logias logias = new Logias(lctxt);
167
    Sexp sysexsexp = logias.buildSexp(arr);
168
    Sexp sexp = logias.run(sysexsexp);
169 1 1. createSysexEvent : negated conditional → NO_COVERAGE
    if (Sexp.nil.equals(sexp)) {
170
      return null;
171
    }
172
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
173 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
    baos.write(SysexMessage.SYSTEM_EXCLUSIVE);    // status: SysEx start
174
    Iterator<Sexp> i = sexp.iterator().assumeList();
175 1 1. createSysexEvent : negated conditional → NO_COVERAGE
    while (i.hasNext()) {
176
      Sexp cur = i.next();
177 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
      baos.write((byte) cur.asAtom().longValue());
178
    }
179 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
    baos.write(SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE);    // End of exclusive
180
    try {
181 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::close → NO_COVERAGE
      baos.close();
182
    } catch (IOException e) {
183
      throw ExceptionThrower.runtimeException(e.getMessage(), e);
184
    }
185
    byte[] data = baos.toByteArray();
186 1 1. createSysexEvent : removed call to javax/sound/midi/SysexMessage::setMessage → NO_COVERAGE
    message.setMessage(data, data.length);
187 1 1. createSysexEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createSysexEvent → NO_COVERAGE
    return new MidiEvent(message, lTick);
188
  }
189
190
  public MidiEvent createControlChangeEvent(int ch, int controllernum, int param, long lTick) throws InvalidMidiDataException {
191
    ShortMessage message = new ShortMessage();
192 1 1. createControlChangeEvent : removed call to javax/sound/midi/ShortMessage::setMessage → KILLED
    message.setMessage(ShortMessage.CONTROL_CHANGE, ch, controllernum, param);
193 1 1. createControlChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createControlChangeEvent → KILLED
    return new MidiEvent(message, lTick);
194
  }
195
196
  public MidiEvent createBankSelectMSBEvent(int ch, int bkmsb, long lTick) throws InvalidMidiDataException {
197 1 1. createBankSelectMSBEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectMSBEvent → KILLED
    return createControlChangeEvent(ch, 0, bkmsb, lTick);
198
  }
199
200
  public MidiEvent createBankSelectLSBEvent(int ch, int bklsb, long lTick) throws InvalidMidiDataException {
201 1 1. createBankSelectLSBEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectLSBEvent → KILLED
    return createControlChangeEvent(ch, 32, bklsb, lTick);
202
  }
203
204
  public MidiEvent createVolumeChangeEvent(int ch, int volume, long lTick) throws InvalidMidiDataException {
205 1 1. createVolumeChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createVolumeChangeEvent → KILLED
    return createControlChangeEvent(ch, 7, volume, lTick);
206
  }
207
208
  public MidiEvent createPanChangeEvent(int ch, int pan, long lTick) throws InvalidMidiDataException {
209 1 1. createPanChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createPanChangeEvent → SURVIVED
    return createControlChangeEvent(ch, 10, pan, lTick);
210
  }
211
212
  public MidiEvent createReverbEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
213 1 1. createReverbEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createReverbEvent → SURVIVED
    return createControlChangeEvent(ch, 91, depth, lTick);
214
  }
215
216
  public MidiEvent createChorusEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
217 1 1. createChorusEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createChorusEvent → SURVIVED
    return createControlChangeEvent(ch, 93, depth, lTick);
218
  }
219
220
  public MidiEvent createPitchBendEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
221
    ShortMessage message = new ShortMessage();
222 1 1. createPitchBendEvent : removed call to javax/sound/midi/ShortMessage::setMessage → SURVIVED
    message.setMessage(ShortMessage.PITCH_BEND, ch, 0, depth);
223 1 1. createPitchBendEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createPitchBendEvent → SURVIVED
    return new MidiEvent(message, lTick);
224
  }
225
226
  public MidiEvent createModulationEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
227 1 1. createModulationEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createModulationEvent → SURVIVED
    return createControlChangeEvent(ch, 1, depth, lTick);
228
  }
229
230
  public MidiEvent createAfterTouchChangeEvent(int ch, int v, long lTick) throws InvalidMidiDataException {
231
    ShortMessage message = new ShortMessage();
232 1 1. createAfterTouchChangeEvent : removed call to javax/sound/midi/ShortMessage::setMessage → NO_COVERAGE
    message.setMessage(ShortMessage.CHANNEL_PRESSURE, ch, v, 0);
233 1 1. createAfterTouchChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createAfterTouchChangeEvent → NO_COVERAGE
    return new MidiEvent(message, lTick);
234
  }
235
236
  public MidiEvent createTempoEvent(int tempo, long lTick) throws InvalidMidiDataException {
237 1 1. createTempoEvent : Replaced integer division with multiplication → NO_COVERAGE
    int mpqn = 60000000 / tempo;
238
    MetaMessage mm = new MetaMessage();
239
    byte[] data = Utils.getIntBytes(mpqn);
240 1 1. createTempoEvent : removed call to javax/sound/midi/MetaMessage::setMessage → NO_COVERAGE
    mm.setMessage(0x51, data, data.length);
241 1 1. createTempoEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createTempoEvent → NO_COVERAGE
    return new MidiEvent(mm, lTick);
242
  }
243
244
  public void noteProcessed() {
245 1 1. noteProcessed : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print(".");
246
  }
247
248
  public void controlEventProcessed() {
249 1 1. controlEventProcessed : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("*");
250
  }
251
252
  public void sysexEventProcessed() {
253 1 1. sysexEventProcessed : removed call to java/io/PrintStream::print → NO_COVERAGE
    System.out.print("X");
254
  }
255
256
  public void barStarted(int barid) {
257 1 1. barStarted : removed call to java/io/PrintStream::println → SURVIVED
    System.out.println("bar[" + barid + "]");
258
  }
259
260
  public void patternStarted() {
261 1 1. patternStarted : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("[");
262
  }
263
264
  public void patternEnded() {
265 1 1. patternEnded : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("]");
266
  }
267
268
  public void barEnded() {
269
  }
270
271
  public void partStarted(String partName) {
272 1 1. partStarted : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("    " + partName + ":");
273
  }
274
275
  public void strokeEnded() {
276 1 1. strokeEnded : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("|");
277
  }
278
279
  public void partEnded() {
280 1 1. partEnded : removed call to java/io/PrintStream::println → SURVIVED
    System.out.println();
281
  }
282
283
  public void aborted() {
284 1 1. aborted : removed call to java/io/PrintStream::println → SURVIVED
    System.out.println("aborted.");
285
  }
286
287
  public void noteSetProcessed() {
288 1 1. noteSetProcessed : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print(";");
289
  }
290
}

Mutations

43

1.1
Location : compile
Killed by : none
removed call to java/io/PrintStream::println → SURVIVED

52

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.cli.subcommands.CompileTest.test(com.github.dakusui.symfonion.tests.cli.subcommands.CompileTest)
negated conditional → KILLED

53

1.1
Location : compile
Killed by : none
Replaced integer division with multiplication → SURVIVED

66

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::barStarted → SURVIVED

69

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::partStarted → SURVIVED

71

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.InvalidJsonErrorTest.missingSection_parts(com.github.dakusui.symfonion.tests.InvalidJsonErrorTest)
negated conditional → KILLED

72

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::aborted → SURVIVED

83

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::patternStarted → SURVIVED

88

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[7: POSITIVE: given: 'sixteenth note with short gate (0.25)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
removed call to com/github/dakusui/symfonion/song/Stroke::compile → KILLED

103

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[3: POSITIVE: given: 'pattern contains note on, note off, program change, and bank change (LSB and MSB)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
negated conditional → KILLED

2.2
Location : compile
Killed by : none
changed conditional boundary → SURVIVED

107

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::strokeEnded → SURVIVED

110

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::patternEnded → SURVIVED

113

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::partEnded → SURVIVED

115

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/core/MidiCompiler::barEnded → SURVIVED

116

1.1
Location : compile
Killed by : none
Changed increment from 1 to -1 → SURVIVED

117

1.1
Location : compile
Killed by : none
Replaced double multiplication with division → SURVIVED

2.2
Location : compile
Killed by : none
Replaced long addition with subtraction → SURVIVED

120

1.1
Location : compile
Killed by : none
removed call to java/io/PrintStream::println → SURVIVED

121

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[2: POSITIVE: given: 'pattern contains no explicit event' when: 'compile' then: 'one message (end of sequence) is found'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with Collections.emptyMap for com/github/dakusui/symfonion/core/MidiCompiler::compile → KILLED

125

1.1
Location : createNoteOnEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[7: POSITIVE: given: 'sixteenth note with short gate (0.25)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOnEvent → KILLED

133

1.1
Location : createNoteOffEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[7: POSITIVE: given: 'sixteenth note with short gate (0.25)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOffEvent → KILLED

146

1.1
Location : createNoteEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[8: POSITIVE: given: 'a note and controls (program change, volume, pan, chorus, reverb, modulation, and pitch)' when: 'compile' then: 'note on/off, program change, and volume are included.'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
removed call to javax/sound/midi/ShortMessage::setMessage → KILLED

150

1.1
Location : createNoteEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[7: POSITIVE: given: 'sixteenth note with short gate (0.25)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteEvent → KILLED

156

1.1
Location : createProgramChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[8: POSITIVE: given: 'a note and controls (program change, volume, pan, chorus, reverb, modulation, and pitch)' when: 'compile' then: 'note on/off, program change, and volume are included.'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
removed call to javax/sound/midi/ShortMessage::setMessage → KILLED

158

1.1
Location : createProgramChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[7: POSITIVE: given: 'sixteenth note with short gate (0.25)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createProgramChangeEvent → KILLED

169

1.1
Location : createSysexEvent
Killed by : none
negated conditional → NO_COVERAGE

173

1.1
Location : createSysexEvent
Killed by : none
removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE

175

1.1
Location : createSysexEvent
Killed by : none
negated conditional → NO_COVERAGE

177

1.1
Location : createSysexEvent
Killed by : none
removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE

179

1.1
Location : createSysexEvent
Killed by : none
removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE

181

1.1
Location : createSysexEvent
Killed by : none
removed call to java/io/ByteArrayOutputStream::close → NO_COVERAGE

186

1.1
Location : createSysexEvent
Killed by : none
removed call to javax/sound/midi/SysexMessage::setMessage → NO_COVERAGE

187

1.1
Location : createSysexEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createSysexEvent → NO_COVERAGE

192

1.1
Location : createControlChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[8: POSITIVE: given: 'a note and controls (program change, volume, pan, chorus, reverb, modulation, and pitch)' when: 'compile' then: 'note on/off, program change, and volume are included.'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
removed call to javax/sound/midi/ShortMessage::setMessage → KILLED

193

1.1
Location : createControlChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[8: POSITIVE: given: 'a note and controls (program change, volume, pan, chorus, reverb, modulation, and pitch)' when: 'compile' then: 'note on/off, program change, and volume are included.'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createControlChangeEvent → KILLED

197

1.1
Location : createBankSelectMSBEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[3: POSITIVE: given: 'pattern contains note on, note off, program change, and bank change (LSB and MSB)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectMSBEvent → KILLED

201

1.1
Location : createBankSelectLSBEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[3: POSITIVE: given: 'pattern contains note on, note off, program change, and bank change (LSB and MSB)' when: 'compile' then: 'number of events and tick length seem ok'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectLSBEvent → KILLED

205

1.1
Location : createVolumeChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.exercise[8: POSITIVE: given: 'a note and controls (program change, volume, pan, chorus, reverb, modulation, and pitch)' when: 'compile' then: 'note on/off, program change, and volume are included.'](com.github.dakusui.symfonion.tests.MidiCompilerTest)
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createVolumeChangeEvent → KILLED

209

1.1
Location : createPanChangeEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createPanChangeEvent → SURVIVED

213

1.1
Location : createReverbEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createReverbEvent → SURVIVED

217

1.1
Location : createChorusEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createChorusEvent → SURVIVED

222

1.1
Location : createPitchBendEvent
Killed by : none
removed call to javax/sound/midi/ShortMessage::setMessage → SURVIVED

223

1.1
Location : createPitchBendEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createPitchBendEvent → SURVIVED

227

1.1
Location : createModulationEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createModulationEvent → SURVIVED

232

1.1
Location : createAfterTouchChangeEvent
Killed by : none
removed call to javax/sound/midi/ShortMessage::setMessage → NO_COVERAGE

233

1.1
Location : createAfterTouchChangeEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createAfterTouchChangeEvent → NO_COVERAGE

237

1.1
Location : createTempoEvent
Killed by : none
Replaced integer division with multiplication → NO_COVERAGE

240

1.1
Location : createTempoEvent
Killed by : none
removed call to javax/sound/midi/MetaMessage::setMessage → NO_COVERAGE

241

1.1
Location : createTempoEvent
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createTempoEvent → NO_COVERAGE

245

1.1
Location : noteProcessed
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

249

1.1
Location : controlEventProcessed
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

253

1.1
Location : sysexEventProcessed
Killed by : none
removed call to java/io/PrintStream::print → NO_COVERAGE

257

1.1
Location : barStarted
Killed by : none
removed call to java/io/PrintStream::println → SURVIVED

261

1.1
Location : patternStarted
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

265

1.1
Location : patternEnded
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

272

1.1
Location : partStarted
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

276

1.1
Location : strokeEnded
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

280

1.1
Location : partEnded
Killed by : none
removed call to java/io/PrintStream::println → SURVIVED

284

1.1
Location : aborted
Killed by : none
removed call to java/io/PrintStream::println → SURVIVED

288

1.1
Location : noteSetProcessed
Killed by : none
removed call to java/io/PrintStream::print → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.15.3