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.compat.exceptions.CompatExceptionThrower;
8
import com.github.dakusui.symfonion.compat.exceptions.SymfonionException;
9
import com.github.dakusui.symfonion.song.*;
10
import com.github.dakusui.symfonion.utils.Fraction;
11
import com.github.dakusui.symfonion.utils.Utils;
12
import com.google.gson.JsonArray;
13
14
import javax.sound.midi.*;
15
import java.io.ByteArrayOutputStream;
16
import java.io.IOException;
17
import java.nio.charset.StandardCharsets;
18
import java.util.HashMap;
19
import java.util.Iterator;
20
import java.util.Map;
21
22
import static com.github.dakusui.symfonion.compat.exceptions.CompatExceptionThrower.ContextKey.JSON_ELEMENT_ROOT;
23
import static com.github.dakusui.symfonion.compat.exceptions.CompatExceptionThrower.exceptionContext;
24
import static com.github.dakusui.symfonion.compat.exceptions.CompatExceptionThrower.partNotFound;
25
import static com.github.dakusui.symfonion.compat.exceptions.ExceptionContext.entry;
26
27
/**
28
 * A class that models a "compiler", which generates MIDI data (`Sequence`) from a given `Song` object.
29
 */
30
public class MidiCompiler {
31
32
  private final Context logiasContext;
33
34
  /**
35
   * Creates an object of this class.
36
   *
37
   * @param logiasContext A context of an interpreter that executes a JSON array as an S-expression.
38
   * @see Logias
39
   * @see Context
40
   */
41
  public MidiCompiler(Context logiasContext) {
42
    this.logiasContext = (logiasContext);
43
  }
44
45
  public Map<String, Sequence> compile(Song song) throws InvalidMidiDataException {
46 1 1. compile : removed call to java/io/PrintStream::println → NO_COVERAGE
    System.err.println("Now compiling...");
47
    int                   resolution = 384;
48
    Map<String, Sequence> ret        = new HashMap<>();
49
    Map<String, Track>    tracks;
50
    tracks = new HashMap<>();
51
    for (String partName : song.partNames()) {
52
      Part     part     = song.part(partName);
53
      String   portName = part.portName();
54
      Sequence sequence = ret.get(portName);
55 1 1. compile : negated conditional → NO_COVERAGE
      if (sequence == null) {
56 1 1. compile : Replaced integer division with multiplication → NO_COVERAGE
        sequence = new Sequence(Sequence.PPQ, resolution / 4);
57
        ret.put(portName, sequence);
58
      }
59
      tracks.put(partName, sequence.createTrack());
60
    }
61
62 1 1. compile : negated conditional → NO_COVERAGE
    Track markerTrack = ret.isEmpty() ? null : ret.values().iterator().next().createTrack();
63
64
    ////
65
    // position is the offset of a bar from the beginning of the sequence.
66
    // Giving the sequencer a grace period to initialize its internal state.
67
    long   barPositionInTicks = 0; //= resolution / 4;
68
    int    measureId          = 0;
69
    Object value              = song.rootJsonObject();
70
    for (Measure measure : song.measures()) {
71
      try (var ignored = exceptionContext(entry(JSON_ELEMENT_ROOT, value))) {
72 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::barStarted → NO_COVERAGE
        barStarted(measureId);
73 1 1. compile : negated conditional → NO_COVERAGE
        if (markerTrack != null) {
74
          try {
75 1 1. compile : negated conditional → NO_COVERAGE
            String labelPart = measure.labels().isEmpty()
76
                ? ""
77
                : " {" + String.join(", ", measure.labels()) + "}";
78
            String partsPart = String.join(", ", measure.activePartNames());
79
            markerTrack.add(createMeasureMarkerEvent(
80
                String.format("[bar %3d]%s - %s", measureId, labelPart, partsPart),
81
                barPositionInTicks));
82
          } catch (InvalidMidiDataException ignored2) {
83
          }
84
        }
85
        Groove groove = measure.groove();
86
        for (String partName : measure.activePartNames()) {
87
          var         track       = getTrack(partName, tracks);
88
          Fraction    relPosInBar = Fraction.ZERO;
89
          int         channel     = song.part(partName).channel();
90
          PartMeasure partMeasure = measure.partMeasureFor(partName);
91 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partStarted → NO_COVERAGE
          partStarted(partName);
92
          try {
93
            Fraction endingPos = Fraction.add(relPosInBar, partMeasure.length());
94
95 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::compile → NO_COVERAGE
            partMeasure.compile(this,
96
                                new MidiCompilerContext(track,
97
                                                        channel,
98
                                                        groove,
99
                                                        barPositionInTicks,
100
                                                        relPosInBar));
101
102
            relPosInBar = endingPos;
103
            ////
104
            // Breaks if relative position goes over the length of the bar.
105 2 1. compile : negated conditional → NO_COVERAGE
2. compile : changed conditional boundary → NO_COVERAGE
            if (Fraction.compare(relPosInBar, measure.beats()) >= 0) {
106
              break;
107
            }
108
          } finally {
109 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partEnded → NO_COVERAGE
            partEnded();
110
          }
111
        }
112 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::barEnded → NO_COVERAGE
        barEnded();
113 1 1. compile : Changed increment from 1 to -1 → NO_COVERAGE
        measureId++;
114 2 1. compile : Replaced double multiplication with division → NO_COVERAGE
2. compile : Replaced long addition with subtraction → NO_COVERAGE
        barPositionInTicks += (long) (measure.beats().doubleValue() * resolution);
115
      }
116
    }
117
    System.err.
118
119 1 1. compile : removed call to java/io/PrintStream::println → NO_COVERAGE
        println("Compilation finished.");
120 1 1. compile : replaced return value with Collections.emptyMap for com/github/dakusui/symfonion/core/MidiCompiler::compile → NO_COVERAGE
    return ret;
121
  }
122
123
  private Track getTrack(String partName, Map<String, Track> tracks) {
124
    Track track = tracks.get(partName);
125 1 1. getTrack : negated conditional → NO_COVERAGE
    if (track == null) {
126 1 1. getTrack : removed call to com/github/dakusui/symfonion/core/MidiCompiler::aborted → NO_COVERAGE
      aborted();
127
      //throw partNotFound(measure.lookUpJsonNode(partName), partName);
128
    }
129 1 1. getTrack : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::getTrack → NO_COVERAGE
    return track;
130
  }
131
132
  /**
133
   * Compiles a {@link CompatSong} object into a map from a port name to {@link Sequence} object.
134
   *
135
   * @param song An object that holds user-provided music data.
136
   * @return A map from a port name to {@code Sequence} object.
137
   * @throws InvalidMidiDataException Won't be thrown.
138
   * @throws SymfonionException       Undefined part name is referenced by a bar.
139
   */
140
  public Map<String, Sequence> compile(CompatSong song) throws InvalidMidiDataException, SymfonionException {
141 1 1. compile : removed call to java/io/PrintStream::println → SURVIVED
    System.err.println("Now compiling...");
142
    int                   resolution = 384;
143
    Map<String, Sequence> ret        = new HashMap<>();
144
    Map<String, Track>    tracks;
145
    tracks = new HashMap<>();
146
    for (String partName : song.partNames()) {
147
      Part     part     = song.part(partName);
148
      String   portName = part.portName();
149
      Sequence sequence = ret.get(portName);
150 1 1. compile : negated conditional → KILLED
      if (sequence == null) {
151 1 1. compile : Replaced integer division with multiplication → SURVIVED
        sequence = new Sequence(Sequence.PPQ, resolution / 4);
152
        ret.put(portName, sequence);
153
      }
154
      tracks.put(partName, sequence.createTrack());
155
    }
156
157 1 1. compile : negated conditional → KILLED
    Track markerTrack = ret.isEmpty() ? null : ret.values().iterator().next().createTrack();
158
159
    ////
160
    // position is the offset of a bar from the beginning of the sequence.
161
    // Giving the sequencer a grace period to initialize its internal state.
162
    long   barPositionInTicks = 0; //= resolution / 4;
163
    int    barid              = 0;
164
    Object value              = song.rootJsonObject();
165
    for (Bar bar : song.bars()) {
166
      try (var ignored = exceptionContext(entry(JSON_ELEMENT_ROOT, value))) {
167 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::barStarted → SURVIVED
        barStarted(barid);
168 1 1. compile : negated conditional → KILLED
        if (markerTrack != null) {
169
          try {
170 1 1. compile : negated conditional → SURVIVED
            String labelPart = bar.labels().isEmpty()
171
                ? ""
172
                : " {" + String.join(", ", bar.labels()) + "}";
173
            String partsPart = String.join(", ", bar.partNames());
174
            markerTrack.add(createMeasureMarkerEvent(
175
                String.format("[bar %3d]%s - %s", barid, labelPart, partsPart),
176
                barPositionInTicks));
177
          } catch (InvalidMidiDataException ignored2) {
178
          }
179
        }
180
        Groove groove = bar.groove();
181
        for (String partName : bar.partNames()) {
182 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partStarted → SURVIVED
          partStarted(partName);
183
          Track track = tracks.get(partName);
184 1 1. compile : negated conditional → KILLED
          if (track == null) {
185 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::aborted → SURVIVED
            aborted();
186
            throw partNotFound(bar.lookUpJsonNode(partName), partName);
187
          }
188
          int channel = song.part(partName).channel();
189
          for (Pattern pattern : bar.patternsForPart(partName)) {
190
            ////
191
            // Each stacked pattern starts at the beginning of the bar.
192
            Fraction relPosInBar = Fraction.ZERO;
193 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::patternStarted → SURVIVED
            patternStarted();
194
            for (PartMeasure partMeasure : pattern.partMeasures()) {
195
              try {
196
                Fraction endingPos = Fraction.add(relPosInBar, partMeasure.length());
197
198 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::compile → KILLED
                partMeasure.compile(this,
199
                                    new MidiCompilerContext(track,
200
                                                            channel,
201
                                                            groove,
202
                                                            barPositionInTicks,
203
                                                            relPosInBar));
204
205
                relPosInBar = endingPos;
206
                ////
207
                // Breaks if relative position goes over the length of the bar.
208 2 1. compile : changed conditional boundary → SURVIVED
2. compile : negated conditional → KILLED
                if (Fraction.compare(relPosInBar, bar.beats()) >= 0) {
209
                  break;
210
                }
211
              } finally {
212 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partMeasureEnded → SURVIVED
                partMeasureEnded();
213
              }
214
            }
215 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::patternEnded → SURVIVED
            patternEnded();
216
          }
217 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::partEnded → SURVIVED
          partEnded();
218
        }
219 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::barEnded → SURVIVED
        barEnded();
220 1 1. compile : Changed increment from 1 to -1 → SURVIVED
        barid++;
221 2 1. compile : Replaced long addition with subtraction → KILLED
2. compile : Replaced double multiplication with division → KILLED
        barPositionInTicks += (long) (bar.beats().doubleValue() * resolution);
222
      }
223
    }
224 1 1. compile : removed call to java/io/PrintStream::println → SURVIVED
    System.err.println("Compilation finished.");
225 1 1. compile : replaced return value with Collections.emptyMap for com/github/dakusui/symfonion/core/MidiCompiler::compile → KILLED
    return ret;
226
  }
227
228
  public MidiEvent createNoteOnEvent(int ch, int nKey, int velocity, long lTick) throws InvalidMidiDataException {
229 1 1. createNoteOnEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOnEvent → KILLED
    return createNoteEvent(ShortMessage.NOTE_ON,
230
                           ch,
231
                           nKey,
232
                           velocity,
233
                           lTick);
234
  }
235
236
  public MidiEvent createNoteOffEvent(int ch, int nKey, long lTick) throws InvalidMidiDataException {
237 1 1. createNoteOffEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOffEvent → KILLED
    return createNoteEvent(ShortMessage.NOTE_OFF,
238
                           ch,
239
                           nKey,
240
                           0,
241
                           lTick);
242
  }
243
244
  protected MidiEvent createNoteEvent(int nCommand,
245
                                      int ch,
246
                                      int nKey,
247
                                      int nVelocity,
248
                                      long lTick) throws InvalidMidiDataException {
249
    ShortMessage message = new ShortMessage();
250 1 1. createNoteEvent : removed call to javax/sound/midi/ShortMessage::setMessage → KILLED
    message.setMessage(nCommand,
251
                       ch,
252
                       nKey,
253
                       nVelocity);
254 1 1. createNoteEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteEvent → KILLED
    return new MidiEvent(message,
255
                         lTick);
256
  }
257
258
  public MidiEvent createProgramChangeEvent(int ch, int pgnum, long lTick) throws InvalidMidiDataException {
259
    ShortMessage message = new ShortMessage();
260 1 1. createProgramChangeEvent : removed call to javax/sound/midi/ShortMessage::setMessage → KILLED
    message.setMessage(ShortMessage.PROGRAM_CHANGE, ch, pgnum, 0);
261
262 1 1. createProgramChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createProgramChangeEvent → KILLED
    return new MidiEvent(message, lTick);
263
  }
264
265
  public MidiEvent createSysexEvent(int ch, JsonArray arr, long lTick) throws InvalidMidiDataException {
266
    SysexMessage message = new SysexMessage();
267
    Context      lctxt   = this.logiasContext.createChild();
268
    Sexp         channel = new Literal(ch);
269
    lctxt.bind("channel", channel);
270
    Logias logias    = new Logias(lctxt);
271
    Sexp   sysexsexp = logias.buildSexp(arr);
272
    Sexp   sexp      = logias.run(sysexsexp);
273 1 1. createSysexEvent : negated conditional → NO_COVERAGE
    if (Sexp.nil.equals(sexp)) {
274
      return null;
275
    }
276
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
277 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
    baos.write(SysexMessage.SYSTEM_EXCLUSIVE);    // status: SysEx start
278
    Iterator<Sexp> i = sexp.iterator().assumeList();
279 1 1. createSysexEvent : negated conditional → NO_COVERAGE
    while (i.hasNext()) {
280
      Sexp cur = i.next();
281 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
      baos.write((byte) cur.asAtom().longValue());
282
    }
283 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
    baos.write(SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE);    // End of exclusive
284
    try {
285 1 1. createSysexEvent : removed call to java/io/ByteArrayOutputStream::close → NO_COVERAGE
      baos.close();
286
    } catch (IOException e) {
287
      throw CompatExceptionThrower.runtimeException(e.getMessage(), e);
288
    }
289
    byte[] data = baos.toByteArray();
290 1 1. createSysexEvent : removed call to javax/sound/midi/SysexMessage::setMessage → NO_COVERAGE
    message.setMessage(data, data.length);
291 1 1. createSysexEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createSysexEvent → NO_COVERAGE
    return new MidiEvent(message, lTick);
292
  }
293
294
  public MidiEvent createControlChangeEvent(int ch, int controllerNum, int param, long lTick) throws InvalidMidiDataException {
295
    ShortMessage message = new ShortMessage();
296 1 1. createControlChangeEvent : removed call to javax/sound/midi/ShortMessage::setMessage → KILLED
    message.setMessage(ShortMessage.CONTROL_CHANGE, ch, controllerNum, param);
297 1 1. createControlChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createControlChangeEvent → KILLED
    return new MidiEvent(message, lTick);
298
  }
299
300
  public MidiEvent createBankSelectMSBEvent(int ch, int bkmsb, long lTick) throws InvalidMidiDataException {
301 1 1. createBankSelectMSBEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectMSBEvent → KILLED
    return createControlChangeEvent(ch, 0, bkmsb, lTick);
302
  }
303
304
  public MidiEvent createBankSelectLSBEvent(int ch, int bklsb, long lTick) throws InvalidMidiDataException {
305 1 1. createBankSelectLSBEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectLSBEvent → KILLED
    return createControlChangeEvent(ch, 32, bklsb, lTick);
306
  }
307
308
  public MidiEvent createVolumeChangeEvent(int ch, int volume, long lTick) throws InvalidMidiDataException {
309 1 1. createVolumeChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createVolumeChangeEvent → KILLED
    return createControlChangeEvent(ch, 7, volume, lTick);
310
  }
311
312
  public MidiEvent createPanChangeEvent(int ch, int pan, long lTick) throws InvalidMidiDataException {
313 1 1. createPanChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createPanChangeEvent → SURVIVED
    return createControlChangeEvent(ch, 10, pan, lTick);
314
  }
315
316
  public MidiEvent createReverbEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
317 1 1. createReverbEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createReverbEvent → SURVIVED
    return createControlChangeEvent(ch, 91, depth, lTick);
318
  }
319
320
  public MidiEvent createChorusEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
321
    ShortMessage message = new ShortMessage();
322 1 1. createChorusEvent : removed call to javax/sound/midi/ShortMessage::setMessage → SURVIVED
    message.setMessage(ShortMessage.CONTROL_CHANGE, ch, 93, depth);
323 1 1. createChorusEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createChorusEvent → SURVIVED
    return new MidiEvent(message, lTick);
324
  }
325
326
  public MidiEvent createPitchBendEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
327
    ShortMessage message = new ShortMessage();
328 1 1. createPitchBendEvent : removed call to javax/sound/midi/ShortMessage::setMessage → SURVIVED
    message.setMessage(ShortMessage.PITCH_BEND, ch, 0, depth);
329 1 1. createPitchBendEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createPitchBendEvent → SURVIVED
    return new MidiEvent(message, lTick);
330
  }
331
332
  public MidiEvent createModulationEvent(int ch, int depth, long lTick) throws InvalidMidiDataException {
333 1 1. createModulationEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createModulationEvent → SURVIVED
    return createControlChangeEvent(ch, 1, depth, lTick);
334
  }
335
336
  public MidiEvent createAfterTouchChangeEvent(int ch, int v, long lTick) throws InvalidMidiDataException {
337
    ShortMessage message = new ShortMessage();
338 1 1. createAfterTouchChangeEvent : removed call to javax/sound/midi/ShortMessage::setMessage → NO_COVERAGE
    message.setMessage(ShortMessage.CHANNEL_PRESSURE, ch, v, 0);
339 1 1. createAfterTouchChangeEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createAfterTouchChangeEvent → NO_COVERAGE
    return new MidiEvent(message, lTick);
340
  }
341
342
  public MidiEvent createTempoEvent(int tempo, long lTick) throws InvalidMidiDataException {
343 1 1. createTempoEvent : Replaced integer division with multiplication → NO_COVERAGE
    int         mpqn = 60000000 / tempo;
344
    MetaMessage mm   = new MetaMessage();
345
    byte[]      data = Utils.getIntBytes(mpqn);
346 1 1. createTempoEvent : removed call to javax/sound/midi/MetaMessage::setMessage → NO_COVERAGE
    mm.setMessage(0x51, data, data.length);
347 1 1. createTempoEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createTempoEvent → NO_COVERAGE
    return new MidiEvent(mm, lTick);
348
  }
349
350
  public MidiEvent createMeasureMarkerEvent(String text, long tick) throws InvalidMidiDataException {
351
    MetaMessage mm   = new MetaMessage();
352
    byte[]      data = text.getBytes(StandardCharsets.UTF_8);
353 1 1. createMeasureMarkerEvent : removed call to javax/sound/midi/MetaMessage::setMessage → SURVIVED
    mm.setMessage(0x06, data, data.length);
354 1 1. createMeasureMarkerEvent : replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createMeasureMarkerEvent → SURVIVED
    return new MidiEvent(mm, tick);
355
  }
356
357
  public void noteProcessed() {
358 1 1. noteProcessed : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print(".");
359
  }
360
361
  public void controlEventProcessed() {
362 1 1. controlEventProcessed : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("*");
363
  }
364
365
  public void sysexEventProcessed() {
366 1 1. sysexEventProcessed : removed call to java/io/PrintStream::print → NO_COVERAGE
    System.out.print("X");
367
  }
368
369
  public void barStarted(int barid) {
370 1 1. barStarted : removed call to java/io/PrintStream::println → SURVIVED
    System.out.println("bar[" + barid + "]");
371
  }
372
373
  public void patternStarted() {
374 1 1. patternStarted : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("[");
375
  }
376
377
  public void patternEnded() {
378 1 1. patternEnded : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("]");
379
  }
380
381
  public void barEnded() {
382
  }
383
384
  public void partStarted(String partName) {
385 1 1. partStarted : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("    " + partName + ":");
386
  }
387
388
  public void partMeasureEnded() {
389 1 1. partMeasureEnded : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print("|");
390
  }
391
392
  public void partEnded() {
393 1 1. partEnded : removed call to java/io/PrintStream::println → SURVIVED
    System.out.println();
394
  }
395
396
  public void aborted() {
397 1 1. aborted : removed call to java/io/PrintStream::println → SURVIVED
    System.out.println("aborted.");
398
  }
399
400
  public void noteSetProcessed() {
401 1 1. noteSetProcessed : removed call to java/io/PrintStream::print → SURVIVED
    System.out.print(";");
402
  }
403
}

Mutations

46

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

55

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

56

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

62

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

72

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

73

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

75

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

91

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

95

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::compile → NO_COVERAGE

105

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

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

109

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

112

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

113

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

114

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

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

119

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

120

1.1
Location : compile
Killed by : none
replaced return value with Collections.emptyMap for com/github/dakusui/symfonion/core/MidiCompiler::compile → NO_COVERAGE

125

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

126

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

129

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

141

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

150

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#3]
negated conditional → KILLED

151

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

157

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#2]
negated conditional → KILLED

167

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

168

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#2]
negated conditional → KILLED

170

1.1
Location : compile
Killed by : none
negated conditional → SURVIVED
Covering tests

182

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

184

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
negated conditional → KILLED

185

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

193

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

198

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
removed call to com/github/dakusui/symfonion/song/PartMeasure::compile → KILLED

208

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
negated conditional → KILLED

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

212

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

215

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

217

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

219

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

220

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

221

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[method:pickupNotation_noteOnAtCorrectTick()]
Replaced long addition with subtraction → KILLED

2.2
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[method:pickupNotation_noteOnAtCorrectTick()]
Replaced double multiplication with division → KILLED

224

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

225

1.1
Location : compile
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#3]
replaced return value with Collections.emptyMap for com/github/dakusui/symfonion/core/MidiCompiler::compile → KILLED

229

1.1
Location : createNoteOnEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOnEvent → KILLED

237

1.1
Location : createNoteOffEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteOffEvent → KILLED

250

1.1
Location : createNoteEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#13]
removed call to javax/sound/midi/ShortMessage::setMessage → KILLED

254

1.1
Location : createNoteEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createNoteEvent → KILLED

260

1.1
Location : createProgramChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#9]
removed call to javax/sound/midi/ShortMessage::setMessage → KILLED

262

1.1
Location : createProgramChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createProgramChangeEvent → KILLED

273

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

277

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

279

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

281

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

283

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

285

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

290

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

291

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

296

1.1
Location : createControlChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#10]
removed call to javax/sound/midi/ShortMessage::setMessage → KILLED

297

1.1
Location : createControlChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createControlChangeEvent → KILLED

301

1.1
Location : createBankSelectMSBEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectMSBEvent → KILLED

305

1.1
Location : createBankSelectLSBEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#4]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createBankSelectLSBEvent → KILLED

309

1.1
Location : createVolumeChangeEvent
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[test-template:exercise(com.github.dakusui.symfonion.testutils.SymfonionTestCase)]/[test-template-invocation:#10]
replaced return value with null for com/github/dakusui/symfonion/core/MidiCompiler::createVolumeChangeEvent → KILLED

313

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

317

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

322

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

323

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

328

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

329

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

333

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

338

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

339

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

343

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

346

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

347

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

353

1.1
Location : createMeasureMarkerEvent
Killed by : none
removed call to javax/sound/midi/MetaMessage::setMessage → SURVIVED
Covering tests

354

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

358

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

362

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

366

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

370

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

374

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

378

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

385

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

389

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

393

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

397

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

401

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

Active mutators

Tests examined


Report generated by PIT 1.19.1