PartMeasure.java

1
package com.github.dakusui.symfonion.song;
2
3
import com.github.dakusui.symfonion.compat.exceptions.SymfonionException;
4
import com.github.dakusui.symfonion.compat.exceptions.SymfonionIllegalFormatException;
5
import com.github.dakusui.symfonion.compat.json.*;
6
import com.github.dakusui.symfonion.core.MidiCompiler;
7
import com.github.dakusui.symfonion.core.MidiCompilerContext;
8
import com.github.dakusui.symfonion.utils.Fraction;
9
import com.github.dakusui.symfonion.utils.Utils;
10
import com.google.gson.*;
11
12
import javax.sound.midi.InvalidMidiDataException;
13
import javax.sound.midi.MidiEvent;
14
import javax.sound.midi.Track;
15
import java.util.LinkedList;
16
import java.util.List;
17
import java.util.Optional;
18
import java.util.regex.Matcher;
19
20
import static com.github.dakusui.symfonion.compat.exceptions.CompatExceptionThrower.*;
21
import static com.github.dakusui.symfonion.compat.exceptions.SymfonionIllegalFormatException.NOTE_LENGTH_EXAMPLE;
22
import static com.github.dakusui.symfonion.compat.exceptions.SymfonionTypeMismatchException.PRIMITIVE;
23
import static com.github.dakusui.symfonion.compat.json.CompatJsonUtils.asJsonArrayWithDefault;
24
import static com.github.dakusui.symfonion.compat.json.CompatJsonUtils.asStringWithDefault;
25
import static com.github.dakusui.symfonion.utils.Fraction.ZERO;
26
import static com.github.valid8j.fluent.Expectations.*;
27
28
/**
29
 * A class that models a measure of a part.
30
 */
31
public class PartMeasure {
32
  public static final  java.util.regex.Pattern NOTE_LENGTH_REGEX_PATTERN
33
                                                                   = java.util.regex.Pattern.compile("(?<num>[1-9][0-9]*)(?<dots>\\.*)(?<articulation>[~^']?)");
34
  private static final java.util.regex.Pattern NOTES_REGEX_PATTERN = java.util.regex.Pattern.compile("(?<noteName>[A-Zac-z])(?<accidentals>[#b]*)(?<octaveShifts>[><]*)(?<accents>[+\\-]*)?");
35
  private static final int                     UNDEFINED_NUM       = -1;
36
  private final        PartMeasureParameters   defaultValues;
37
  private final        double                  gate;
38
  private final        int[]                   volume;
39
  private final        int[]                   pan;
40
  private final        int[]                   reverb;
41
  private final        int[]                   chorus;
42
  private final        int[]                   pitch;
43
  private final        int[]                   modulation;
44
  private final        int                     pgno;
45
  private final        String                  bkno;
46
  private final        int                     tempo;
47
  private final        JsonArray               sysex;
48
  private final        int[]                   aftertouch;
49
  private final        StrokeSequence          strokeSequence;
50
51
  /**
52
   * The ```partMeasureJson``` needs to be a JSON element which can promote to the following object
53
   * with ```CompatJsonUtils#asJsonArrayWithPromotion( JsonElement, Object...)```.
54
   *
55
   * // @formatter:off
56
   * [source, JSON]
57
   * .partMeasureJson
58
   * ----
59
   * {
60
   *   "notes": "<strokeSequence:array>",
61
   *   "length": "<length:string@{Fraction}>",
62
   *   "gate": "<gate:number@{double}>",
63
   *   "volume": "<volume:array@{int}>",
64
   *   "pan": "<pan:array@{int}>",
65
   *   "reverb": "<reverb:array@{int}>",
66
   *   "chorus": "<chorus:array@{int}>",
67
   *   "modulation": "<modulation:array@{int}>",
68
   *   "aftertouch": "<aftertouch:array@{int}>",
69
   *   "sysex": "<sysex:array@{int}>"
70
   * }
71
   * ----
72
   *
73
   * If it doesn't have a corresponding element, it will be considered `null` is specified.
74
   * The **NOTES String** should match the following regular expression or such strings concatenated by `;`.
75
   *
76
   * `([A-Zac-z])([#b]*)([><]*)([\\+\\-]*)?`
77
   *
78
   * That is, the data this class host is actually a sequence of strokes, not merely a stroke.
79
   * Historical reason introduced this naming inconsistency.
80
   *
81
   * // Using `@see` at the bottom of this comment will break `mvn javadoc:javadoc` for unknown reason.
82
   * See also {@code Pattern.Parameters} and {@code CompatJsonUtils#asJsonArrayWithDefault(JsonElement, JsonArray, Object...)}.
83
   *
84
   * // @formatter:on
85
   *
86
   * @param partMeasureJson A JSON object to be interpreted as a stroke.
87
   * @param params Default values of strokes when omitted.
88
   * @throws SymfonionException Failed to process `partMeasureJson`.
89
   * @throws CompatJsonException Failed to interpret `partMeasureJson`.
90
   *
91
   */
92
  public PartMeasure(JsonElement partMeasureJson, PartMeasureParameters params) throws SymfonionException, CompatJsonException {
93
    this(CompatJsonUtils.asJsonObjectWithPromotion(partMeasureJson, new String[]{Keyword.notes.name(), Keyword.length.name()}), params);
94
  }
95
96
  public PartMeasure(JsonObject obj, PartMeasureParameters defaultValues) throws SymfonionException, CompatJsonException {
97 1 1. <init> : negated conditional → KILLED
    this.tempo          = CompatJsonUtils.hasPath(obj, Keyword.tempo) ? CompatJsonUtils.asInt(obj, Keyword.tempo) : UNDEFINED_NUM;
98 1 1. <init> : negated conditional → KILLED
    this.pgno           = CompatJsonUtils.hasPath(obj, Keyword.program) ? CompatJsonUtils.asInt(obj, Keyword.program) : UNDEFINED_NUM;
99
    this.bkno           = resolveBankNumber(obj);
100
    this.volume         = getIntArray(obj, Keyword.volume);
101
    this.pan            = getIntArray(obj, Keyword.pan);
102
    this.reverb         = getIntArray(obj, Keyword.reverb);
103
    this.chorus         = getIntArray(obj, Keyword.chorus);
104
    this.pitch          = getIntArray(obj, Keyword.pitch);
105
    this.modulation     = getIntArray(obj, Keyword.modulation);
106
    this.aftertouch     = getIntArray(obj, Keyword.aftertouch);
107
    this.sysex          = asJsonArrayWithDefault(obj, null, Keyword.sysex);
108
    this.gate           = resolveGate(obj, defaultValues);
109
    this.strokeSequence = parseStrokeSequence(asStringWithDefault(obj, null, Keyword.notes),
110
                                              resolveDefaultStrokeLength(obj, defaultValues),
111
                                              defaultValues.noteMap);
112
    this.defaultValues  = defaultValues;
113
  }
114
115
  /**
116
   * Compiles this object using a given `compiler` and store its result in the `context`.
117
   *
118
   * @param compiler A compiler with which this object is processed.
119
   * @param context  A context in which the compiled result is stored.
120
   * @throws InvalidMidiDataException Failed to generate MIDI data.
121
   */
122
  public void compile(final MidiCompiler compiler, MidiCompilerContext context) throws InvalidMidiDataException {
123
    final Track track = context.track();
124
    final int   ch    = context.channel();
125
    long absolutePosition = convertRelativePositionInPartMeasureToAbsolutePositionInTicks(context,
126
                                                                                          ZERO);
127
    long partMeasureLength = calculatePartMeasureLengthInTicks(this, context);
128 1 1. compile : negated conditional → KILLED
    if (tempo != UNDEFINED_NUM) {
129
      track.add(compiler.createTempoEvent(this.tempo, absolutePosition));
130 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::controlEventProcessed → NO_COVERAGE
      compiler.controlEventProcessed();
131
    }
132 1 1. compile : negated conditional → KILLED
    if (bkno != null) {
133
      int msb = Integer.parseInt(bkno.substring(0, this.bkno.indexOf('.')));
134
      track.add(compiler.createBankSelectMSBEvent(ch, msb, absolutePosition));
135 1 1. compile : negated conditional → KILLED
      if (this.bkno.indexOf('.') != -1) {
136 1 1. compile : Replaced integer addition with subtraction → KILLED
        int lsb = Integer.parseInt(bkno.substring(this.bkno.indexOf('.') + 1));
137
        track.add(compiler.createBankSelectLSBEvent(ch, lsb, absolutePosition));
138
      }
139 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::controlEventProcessed → SURVIVED
      compiler.controlEventProcessed();
140
    }
141 1 1. compile : negated conditional → KILLED
    if (pgno != UNDEFINED_NUM) {
142
      track.add(compiler.createProgramChangeEvent(ch, this.pgno, absolutePosition));
143 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::controlEventProcessed → SURVIVED
      compiler.controlEventProcessed();
144
    }
145 1 1. compile : negated conditional → KILLED
    if (sysex != null) {
146
      MidiEvent ev = compiler.createSysexEvent(ch, sysex, absolutePosition);
147 1 1. compile : negated conditional → NO_COVERAGE
      if (ev != null) {
148
        track.add(ev);
149 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::sysexEventProcessed → NO_COVERAGE
        compiler.sysexEventProcessed();
150
      }
151
    }
152 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → KILLED
    renderArrayedValues(volume, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createVolumeChangeEvent(ch, v, pos)));
153 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
    renderArrayedValues(pan, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createPanChangeEvent(ch, v, pos)));
154 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
    renderArrayedValues(reverb, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createReverbEvent(ch, v, pos)));
155 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
    renderArrayedValues(chorus, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createChorusEvent(ch, v, pos)));
156 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
    renderArrayedValues(pitch, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createPitchBendEvent(ch, v, pos)));
157 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
    renderArrayedValues(modulation, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createModulationEvent(ch, v, pos)));
158 1 1. compile : removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
    renderArrayedValues(aftertouch, absolutePosition, partMeasureLength, compiler, (v, pos) -> track.add(compiler.createAfterTouchChangeEvent(ch, v, pos)));
159
    int      transpose      = this.defaultValues().transpose();
160
    int      arpegioDelay   = this.defaultValues().arpeggio();
161
    int      delta          = 0;
162
    Fraction relPosInStroke = Fraction.subtract(ZERO, this.strokeSequence.pickUpLength());
163
    for (Stroke stroke : this.strokes()) {
164
      absolutePosition = convertRelativePositionInPartMeasureToAbsolutePositionInTicks(context, relPosInStroke);
165
      long absolutePositionWhereNoteFinishes = convertRelativePositionInPartMeasureToAbsolutePositionInTicks(context,
166
                                                                                                             Fraction.add(relPosInStroke, stroke.length()));
167 1 1. compile : Replaced long subtraction with addition → KILLED
      long noteLengthInTicks                 = absolutePositionWhereNoteFinishes - absolutePosition;
168
      for (Note note : stroke.notes()) {
169 1 1. compile : Replaced integer addition with subtraction → SURVIVED
        int key = note.key() + transpose;
170
        int velocity = Math.max(0, Math.min(127, this.defaultValues().velocityBase() +
171 2 1. compile : Replaced integer addition with subtraction → SURVIVED
2. compile : Replaced integer multiplication with division → SURVIVED
                                                 note.accent() * this.defaultValues().velocityDelta() +
172 1 1. compile : Replaced integer addition with subtraction → SURVIVED
                                                 context.groove().calculateGrooveAccent(relPosInStroke,
173
                                                                                        context.relativeStrokePositionInBar())));
174 1 1. compile : Replaced long addition with subtraction → SURVIVED
        track.add(compiler.createNoteOnEvent(ch, key, velocity, absolutePosition + delta));
175 3 1. compile : Replaced long addition with subtraction → SURVIVED
2. compile : Replaced double multiplication with division → KILLED
3. compile : Replaced double addition with subtraction → KILLED
        track.add(compiler.createNoteOffEvent(ch, key, (long) (absolutePosition + delta + noteLengthInTicks * this.gate())));
176 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::noteProcessed → SURVIVED
        compiler.noteProcessed();
177 1 1. compile : Replaced integer addition with subtraction → SURVIVED
        delta += arpegioDelay;
178
      }
179 1 1. compile : removed call to com/github/dakusui/symfonion/core/MidiCompiler::noteSetProcessed → SURVIVED
      compiler.noteSetProcessed();
180
      relPosInStroke = Fraction.add(relPosInStroke, stroke.length());
181
    }
182
  }
183
184
  /**
185
   * Returns the length of this object.
186
   *
187
   * @return The length of a stroke.
188
   */
189
  public Fraction length() {
190 1 1. length : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::length → KILLED
    return strokeSequence.length();
191
  }
192
193
  /**
194
   * Returns the gate of a stroke in this object.
195
   * It shows the ratio to keep pressing a key to the entire length of a stroke.
196
   *
197
   * @return The gate of a stroke.
198
   */
199
  public double gate() {
200 1 1. gate : replaced double return with 0.0d for com/github/dakusui/symfonion/song/PartMeasure::gate → KILLED
    return this.gate;
201
  }
202
203
  /**
204
   * Returns a `PartMeasureParameters` object that defines default values of this `PartMeasure` object.
205
   *
206
   * @return A `PartMeasureParameters` object.
207
   * @see PartMeasureParameters
208
   */
209
  public PartMeasureParameters defaultValues() {
210 1 1. defaultValues : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::defaultValues → KILLED
    return this.defaultValues;
211
  }
212
213
  List<Stroke> strokes() {
214 1 1. strokes : replaced return value with Collections.emptyList for com/github/dakusui/symfonion/song/PartMeasure::strokes → KILLED
    return this.strokeSequence.strokes();
215
  }
216
217
  private static StrokeSequence parseStrokeSequence(String strokes, Fraction defaultNoteLength, NoteMap noteMap) {
218 2 1. parseStrokeSequence : negated conditional → KILLED
2. parseStrokeSequence : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::parseStrokeSequence → KILLED
    if (strokes == null) return new StrokeSequence(ZERO, defaultNoteLength, new LinkedList<>());
219
    List<Stroke> noteSets        = new LinkedList<>();
220
    Fraction     currentPosition = ZERO;
221
    Fraction     pickUpLength    = ZERO;
222
    for (String stroke : strokes.splitWithDelimiters("[;\\|]", 0)) {
223 1 1. parseStrokeSequence : negated conditional → KILLED
      if (";".equals(stroke)) continue;
224 1 1. parseStrokeSequence : negated conditional → KILLED
      if ("|".equals(stroke)) {
225
        pickUpLength    = currentPosition;
226
        currentPosition = ZERO;
227
        continue;
228
      }
229
      Stroke result = parseStroke(stroke, defaultNoteLength, noteMap);
230
      noteSets.add(new Stroke(result.length(), result.notes()));
231
      currentPosition = Fraction.add(currentPosition, result.length());
232
    }
233 1 1. parseStrokeSequence : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::parseStrokeSequence → KILLED
    return new StrokeSequence(pickUpLength, currentPosition, noteSets);
234
  }
235
236
  private static Fraction resolveDefaultStrokeLength(JsonObject obj, PartMeasureParameters params) {
237
    Fraction len = params.length();
238 1 1. resolveDefaultStrokeLength : negated conditional → KILLED
    if (CompatJsonUtils.hasPath(obj, Keyword.length)) {
239
      len = validateLength(CompatJsonUtils.asJsonElement(obj, Keyword.length));
240
    }
241 1 1. resolveDefaultStrokeLength : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::resolveDefaultStrokeLength → KILLED
    return len;
242
  }
243
244
  private static double resolveGate(JsonObject obj, PartMeasureParameters params) {
245
    double gate = params.gate();
246 1 1. resolveGate : negated conditional → KILLED
    if (CompatJsonUtils.hasPath(obj, Keyword.gate)) {
247
      gate = CompatJsonUtils.asDouble(obj, Keyword.gate);
248
    }
249 1 1. resolveGate : replaced double return with 0.0d for com/github/dakusui/symfonion/song/PartMeasure::resolveGate → KILLED
    return gate;
250
  }
251
252
  private static String resolveBankNumber(JsonObject obj) {
253
    final String bkno;
254 1 1. resolveBankNumber : negated conditional → KILLED
    if (CompatJsonUtils.hasPath(obj, Keyword.bank)) {
255
      bkno = CompatJsonUtils.asString(obj, Keyword.bank);
256
      // Checks if this.bkno can be parsed as a double value.
257
      assert bkno != null;
258
      //noinspection ResultOfMethodCallIgnored
259
      Double.parseDouble(bkno);
260
    } else bkno = null;
261 1 1. resolveBankNumber : replaced return value with "" for com/github/dakusui/symfonion/song/PartMeasure::resolveBankNumber → KILLED
    return bkno;
262
  }
263
264
  private static long convertRelativePositionInPartMeasureToAbsolutePositionInTicks(MidiCompilerContext midiCompilerContext,
265
                                                                                    Fraction relativePositionInStroke) {
266 1 1. convertRelativePositionInPartMeasureToAbsolutePositionInTicks : replaced long return with 0 for com/github/dakusui/symfonion/song/PartMeasure::convertRelativePositionInPartMeasureToAbsolutePositionInTicks → KILLED
    return midiCompilerContext.groove().calculateAbsolutePositionInTicks(relativePositionInStroke,
267
                                                                         midiCompilerContext.relativeStrokePositionInBar(),
268
                                                                         midiCompilerContext.absoluteBarPositionInTicks());
269
  }
270
271
  private static long calculatePartMeasureLengthInTicks(PartMeasure partMeasure, MidiCompilerContext midiCompilerContext) {
272 1 1. calculatePartMeasureLengthInTicks : replaced long return with 0 for com/github/dakusui/symfonion/song/PartMeasure::calculatePartMeasureLengthInTicks → SURVIVED
    return convertRelativePositionInPartMeasureToAbsolutePositionInTicks(midiCompilerContext, partMeasure.length());
273
  }
274
275
276
  private static Fraction validateLength(JsonElement lenJSON) {
277
    Fraction len;
278 1 1. validateLength : negated conditional → KILLED
    if (lenJSON.isJsonPrimitive()) {
279
      len = parseNoteLength(lenJSON.getAsString());
280 1 1. validateLength : negated conditional → KILLED
      if (len == null) {
281
        throw illegalFormatException(lenJSON, NOTE_LENGTH_EXAMPLE);
282
      }
283
    } else {
284
      throw typeMismatchException(lenJSON, PRIMITIVE);
285
    }
286 1 1. validateLength : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::validateLength → NO_COVERAGE
    return len;
287
  }
288
289
  private static Stroke parseStroke(String nn, Fraction defaultNoteLength, NoteMap noteMap) {
290
    LinkedList<Note> ns = new LinkedList<>();
291 1 1. parseStroke : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::parseStroke → KILLED
    return new Stroke(Optional.ofNullable(parseStroke(ns, nn, noteMap))
292
                              .map(PartMeasure::parseNoteLength)
293
                              .orElse(defaultNoteLength),
294
                      ns);
295
  }
296
297
  /**
298
   * Returns the 'length' portion of the string <code>stroke</code>.
299
   *
300
   * @param noteMap A note map that stores a map from  a code (`A`, `B`, `C`, ...) to a note.
301
   * @param out     A list that stores parsed result will be added.
302
   * @return The remaining part that was not parsed by this invocation.
303
   * `null` if this invocation parses the entire `notes` string.
304
   */
305
  private static String parseStroke(List<Note> out, String stroke, NoteMap noteMap) throws SymfonionException {
306
    Matcher m = NOTES_REGEX_PATTERN.matcher(stroke);
307
    int     i;
308 1 1. parseStroke : negated conditional → KILLED
    for (i = 0; m.find(i); i = m.end()) {
309 1 1. parseStroke : negated conditional → KILLED
      if (i != m.start()) {
310
        throw syntaxErrorInNotePattern(stroke, i, m);
311
      }
312
      int n_ = noteMap.noteFor(m.group("noteName"));
313 2 1. parseStroke : changed conditional boundary → SURVIVED
2. parseStroke : negated conditional → KILLED
      if (n_ >= 0) {
314 6 1. parseStroke : Replaced integer multiplication with division → SURVIVED
2. parseStroke : Replaced integer multiplication with division → SURVIVED
3. parseStroke : Replaced integer addition with subtraction → SURVIVED
4. parseStroke : Replaced integer subtraction with addition → SURVIVED
5. parseStroke : Replaced integer addition with subtraction → SURVIVED
6. parseStroke : Replaced integer subtraction with addition → SURVIVED
        int  n  = n_ + Utils.count('#', m.group("accidentals")) - Utils.count('b', m.group("accidentals")) + Utils.count('>', m.group("octaveShifts")) * 12 - Utils.count('<', m.group("octaveShifts")) * 12;
315 1 1. parseStroke : Replaced integer subtraction with addition → SURVIVED
        int  a  = Utils.count('+', m.group("accents")) - Utils.count('-', m.group("accents"));
316
        Note nn = new Note(n, a);
317
        out.add(nn);
318
      }
319
    }
320
    Matcher n   = NOTE_LENGTH_REGEX_PATTERN.matcher(stroke);
321
    String  ret = null;
322 1 1. parseStroke : negated conditional → KILLED
    if (n.find(i)) {
323
      ret = stroke.substring(n.start(), n.end());
324
      i   = n.end();
325
    }
326 1 1. parseStroke : negated conditional → KILLED
    if (i != stroke.length()) {
327
      throw illegalNoteFormat(stroke, i);
328
    }
329 1 1. parseStroke : replaced return value with "" for com/github/dakusui/symfonion/song/PartMeasure::parseStroke → KILLED
    return ret;
330
331
  }
332
333
  private static void renderArrayedValues(int[] values, long pos, long partMeasureLength, MidiCompiler compiler, EventCreator creator) throws InvalidMidiDataException {
334 1 1. renderArrayedValues : negated conditional → KILLED
    if (values == null) {
335
      return;
336
    }
337 1 1. renderArrayedValues : Replaced long division with multiplication → SURVIVED
    long step = partMeasureLength / values.length;
338 2 1. renderArrayedValues : changed conditional boundary → KILLED
2. renderArrayedValues : negated conditional → KILLED
    for (int i = 0; i < values.length; i++) {
339 3 1. renderArrayedValues : Replaced long addition with subtraction → SURVIVED
2. renderArrayedValues : removed call to com/github/dakusui/symfonion/song/PartMeasure$EventCreator::createEvent → KILLED
3. renderArrayedValues : Replaced long multiplication with division → KILLED
      creator.createEvent(values[i], pos + step * i);
340 1 1. renderArrayedValues : removed call to com/github/dakusui/symfonion/core/MidiCompiler::controlEventProcessed → SURVIVED
      compiler.controlEventProcessed();
341
    }
342
  }
343
344
  public static Fraction parseNoteLength(String length) {
345
    Matcher  m   = NOTE_LENGTH_REGEX_PATTERN.matcher(length);
346
    Fraction ret = null;
347 1 1. parseNoteLength : negated conditional → KILLED
    if (m.matches()) {
348
      int l = Integer.parseInt(m.group("num"));
349
      ret = new Fraction(1, l);
350
      int dots = Utils.count('.', m.group("dots"));
351 2 1. parseNoteLength : negated conditional → KILLED
2. parseNoteLength : changed conditional boundary → KILLED
      for (int i = 0; i < dots; i++) {
352 1 1. parseNoteLength : Replaced integer multiplication with division → KILLED
        l *= 2;
353
        ret = Fraction.add(ret, new Fraction(1, l));
354
      }
355 1 1. parseNoteLength : negated conditional → KILLED
    } else if ("0".equals(length)) {
356
      ret = new Fraction(0, 1);
357
    }
358 1 1. parseNoteLength : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::parseNoteLength → KILLED
    return ret;
359
  }
360
361
  private static int[] getIntArray(JsonObject cur, Keyword kw) throws JsonInvalidPathException, JsonTypeMismatchException, JsonFormatException {
362
    int[] ret;
363 1 1. getIntArray : negated conditional → KILLED
    if (!CompatJsonUtils.hasPath(cur, kw)) {
364
      return null;
365
    }
366
    JsonElement json = CompatJsonUtils.asJsonElement(cur, kw);
367 1 1. getIntArray : negated conditional → KILLED
    if (json.isJsonArray()) {
368
      JsonArray arr = json.getAsJsonArray();
369
      ret = interpolate(expandDots(arr));
370
    } else {
371
      ret    = new int[1];
372
      ret[0] = CompatJsonUtils.asInt(cur, kw);
373
    }
374 1 1. getIntArray : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::getIntArray → KILLED
    return ret;
375
  }
376
377
  private static JsonArray expandDots(JsonArray arr) throws SymfonionIllegalFormatException {
378
    JsonArray ret = new JsonArray();
379 2 1. expandDots : changed conditional boundary → KILLED
2. expandDots : negated conditional → KILLED
    for (int i = 0; i < arr.size(); i++) {
380
      JsonElement cur = arr.get(i);
381 1 1. expandDots : negated conditional → KILLED
      if (cur.isJsonPrimitive()) {
382
        JsonPrimitive p = cur.getAsJsonPrimitive();
383 3 1. expandDots : negated conditional → KILLED
2. expandDots : removed call to com/google/gson/JsonArray::add → KILLED
3. expandDots : negated conditional → KILLED
        if (p.isBoolean() || p.isNumber()) ret.add(p);
384 1 1. expandDots : negated conditional → KILLED
        else if (p.isString()) {
385
          String s = p.getAsString();
386 2 1. expandDots : negated conditional → KILLED
2. expandDots : changed conditional boundary → KILLED
          for (int j = 0; j < s.length(); j++) {
387 2 1. expandDots : removed call to com/google/gson/JsonArray::add → KILLED
2. expandDots : negated conditional → KILLED
            if (s.charAt(j) == '.') ret.add(JsonNull.INSTANCE);
388
            else throw syntaxErrorWhenExpandingDotsIn(arr);
389
          }
390
        }
391 2 1. expandDots : removed call to com/google/gson/JsonArray::add → KILLED
2. expandDots : negated conditional → KILLED
      } else if (cur.isJsonNull()) ret.add(cur);
392
      else throw typeMismatchWhenExpandingDotsIn(arr);
393
    }
394 1 1. expandDots : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::expandDots → KILLED
    return ret;
395
  }
396
397
  private static int[] interpolate(JsonArray arr) {
398
    int[]     ret;
399
    Integer[] tmp = new Integer[arr.size()];
400 2 1. interpolate : changed conditional boundary → KILLED
2. interpolate : negated conditional → KILLED
    for (int i = 0; i < tmp.length; i++) {
401 2 1. interpolate : negated conditional → KILLED
2. interpolate : negated conditional → KILLED
      if (arr.get(i) == null || arr.get(i).isJsonNull()) {
402
        tmp[i] = null;
403
      } else {
404
        tmp[i] = arr.get(i).getAsInt();
405
      }
406
    }
407
    ret = new int[arr.size()];
408
    int start = 0;
409
    int end   = 0;
410 2 1. interpolate : changed conditional boundary → KILLED
2. interpolate : negated conditional → KILLED
    for (int i = 0; i < tmp.length; i++) {
411 1 1. interpolate : negated conditional → SURVIVED
      if (tmp[i] != null) {
412
        start = ret[i] = tmp[i];
413
      } else {
414 1 1. interpolate : Replaced integer addition with subtraction → TIMED_OUT
        int j = i + 1;
415 2 1. interpolate : changed conditional boundary → SURVIVED
2. interpolate : negated conditional → KILLED
        while (j < tmp.length) {
416 1 1. interpolate : negated conditional → KILLED
          if (tmp[j] != null) {
417
            end    = tmp[j];
418
            ret[j] = end;
419
            break;
420
          }
421
          j++;
422
        }
423 3 1. interpolate : Replaced integer subtraction with addition → SURVIVED
2. interpolate : Replaced integer subtraction with addition → SURVIVED
3. interpolate : Replaced integer division with multiplication → KILLED
        int step   = (end - start) / (j - i);
424
        int curval = start;
425 2 1. interpolate : changed conditional boundary → SURVIVED
2. interpolate : negated conditional → KILLED
        for (int k = i; k < j; k++) {
426 1 1. interpolate : Replaced integer addition with subtraction → KILLED
                   curval += step;
427
          ret[k] = curval;
428
        }
429
        i = j;
430
      }
431
    }
432 1 1. interpolate : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::interpolate → KILLED
    return ret;
433
  }
434
435
  /**
436
   * An interface to abstract an operation to create a MIDI event.
437
   */
438
  interface EventCreator {
439
    void createEvent(int v, long pos) throws InvalidMidiDataException;
440
  }
441
442
  private record StrokeSequence(Fraction pickUpLength,
443
                                Fraction length,
444
                                List<Stroke> strokes) {
445
    StrokeSequence {
446 1 1. lambda$new$0 : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure$StrokeSequence::lambda$new$0 → KILLED
      assert preconditions(value(pickUpLength).satisfies(x -> x.toBe().notNull())
447
                                              .satisfies(x -> x.invokeStatic(Fraction.class, "compare", parameter(), ZERO)
448
                                                               .asInteger()
449 1 1. lambda$new$1 : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure$StrokeSequence::lambda$new$1 → KILLED
                                                               .toBe()
450
                                                               .greaterThanOrEqualTo(0)),
451 1 1. lambda$new$2 : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure$StrokeSequence::lambda$new$2 → KILLED
                           value(length).satisfies(x -> x.toBe().notNull())
452
                                        .satisfies(x -> x.invokeStatic(Fraction.class, "compare", parameter(), ZERO)
453
                                                         .asInteger()
454 1 1. lambda$new$3 : replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure$StrokeSequence::lambda$new$3 → KILLED
                                                         .toBe()
455
                                                         .greaterThanOrEqualTo(0)),
456
                           value(strokes).toBe()
457
                                         .notNull());
458
    }
459
  }
460
461
  private record Stroke(Fraction length, List<Note> notes) {
462
  }
463
}

Mutations

97

1.1
Location : <init>
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

98

1.1
Location : <init>
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

128

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

130

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

132

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

135

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

136

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]
Replaced integer addition with subtraction → KILLED

139

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

141

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

143

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

145

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

147

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

149

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

152

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:#10]
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → KILLED

153

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
Covering tests

154

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
Covering tests

155

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
Covering tests

156

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
Covering tests

157

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
Covering tests

158

1.1
Location : compile
Killed by : none
removed call to com/github/dakusui/symfonion/song/PartMeasure::renderArrayedValues → SURVIVED
Covering tests

167

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:#7]
Replaced long subtraction with addition → KILLED

169

1.1
Location : compile
Killed by : none
Replaced integer addition with subtraction → SURVIVED
Covering tests

171

1.1
Location : compile
Killed by : none
Replaced integer addition with subtraction → SURVIVED
Covering tests

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

172

1.1
Location : compile
Killed by : none
Replaced integer addition with subtraction → SURVIVED
Covering tests

174

1.1
Location : compile
Killed by : none
Replaced long addition with subtraction → SURVIVED
Covering tests

175

1.1
Location : compile
Killed by : none
Replaced long addition with subtraction → SURVIVED
Covering tests

2.2
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]
Replaced double multiplication with division → KILLED

3.3
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:#8]
Replaced double addition with subtraction → KILLED

176

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

177

1.1
Location : compile
Killed by : none
Replaced integer addition with subtraction → SURVIVED
Covering tests

179

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

190

1.1
Location : length
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/song/PartMeasure::length → KILLED

200

1.1
Location : gate
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:#8]
replaced double return with 0.0d for com/github/dakusui/symfonion/song/PartMeasure::gate → KILLED

210

1.1
Location : defaultValues
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/song/PartMeasure::defaultValues → KILLED

214

1.1
Location : strokes
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 Collections.emptyList for com/github/dakusui/symfonion/song/PartMeasure::strokes → KILLED

218

1.1
Location : parseStrokeSequence
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 : parseStrokeSequence
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/song/PartMeasure::parseStrokeSequence → KILLED

223

1.1
Location : parseStrokeSequence
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

224

1.1
Location : parseStrokeSequence
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

233

1.1
Location : parseStrokeSequence
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/song/PartMeasure::parseStrokeSequence → KILLED

238

1.1
Location : resolveDefaultStrokeLength
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

241

1.1
Location : resolveDefaultStrokeLength
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/song/PartMeasure::resolveDefaultStrokeLength → KILLED

246

1.1
Location : resolveGate
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

249

1.1
Location : resolveGate
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:#8]
replaced double return with 0.0d for com/github/dakusui/symfonion/song/PartMeasure::resolveGate → KILLED

254

1.1
Location : resolveBankNumber
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

261

1.1
Location : resolveBankNumber
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 "" for com/github/dakusui/symfonion/song/PartMeasure::resolveBankNumber → KILLED

266

1.1
Location : convertRelativePositionInPartMeasureToAbsolutePositionInTicks
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 long return with 0 for com/github/dakusui/symfonion/song/PartMeasure::convertRelativePositionInPartMeasureToAbsolutePositionInTicks → KILLED

272

1.1
Location : calculatePartMeasureLengthInTicks
Killed by : none
replaced long return with 0 for com/github/dakusui/symfonion/song/PartMeasure::calculatePartMeasureLengthInTicks → SURVIVED
Covering tests

278

1.1
Location : validateLength
Killed by : com.github.dakusui.symfonion.tests.InvalidDataErrorTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.InvalidDataErrorTest]/[method:illegalNoteLength_03()]
negated conditional → KILLED

280

1.1
Location : validateLength
Killed by : com.github.dakusui.symfonion.tests.InvalidDataErrorTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.InvalidDataErrorTest]/[method:illegalNoteLength_03()]
negated conditional → KILLED

286

1.1
Location : validateLength
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::validateLength → NO_COVERAGE

291

1.1
Location : parseStroke
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/song/PartMeasure::parseStroke → KILLED

308

1.1
Location : parseStroke
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

309

1.1
Location : parseStroke
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

313

1.1
Location : parseStroke
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 : parseStroke
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

314

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

2.2
Location : parseStroke
Killed by : none
Replaced integer multiplication with division → SURVIVED Covering tests

3.3
Location : parseStroke
Killed by : none
Replaced integer addition with subtraction → SURVIVED Covering tests

4.4
Location : parseStroke
Killed by : none
Replaced integer subtraction with addition → SURVIVED Covering tests

5.5
Location : parseStroke
Killed by : none
Replaced integer addition with subtraction → SURVIVED Covering tests

6.6
Location : parseStroke
Killed by : none
Replaced integer subtraction with addition → SURVIVED Covering tests

315

1.1
Location : parseStroke
Killed by : none
Replaced integer subtraction with addition → SURVIVED
Covering tests

322

1.1
Location : parseStroke
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

326

1.1
Location : parseStroke
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

329

1.1
Location : parseStroke
Killed by : com.github.dakusui.symfonion.tests.MidiCompilerTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.MidiCompilerTest]/[method:pickupNotation_noteOnAtCorrectTick()]
replaced return value with "" for com/github/dakusui/symfonion/song/PartMeasure::parseStroke → KILLED

334

1.1
Location : renderArrayedValues
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

337

1.1
Location : renderArrayedValues
Killed by : none
Replaced long division with multiplication → SURVIVED
Covering tests

338

1.1
Location : renderArrayedValues
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]
changed conditional boundary → KILLED

2.2
Location : renderArrayedValues
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]
negated conditional → KILLED

339

1.1
Location : renderArrayedValues
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 com/github/dakusui/symfonion/song/PartMeasure$EventCreator::createEvent → KILLED

2.2
Location : renderArrayedValues
Killed by : none
Replaced long addition with subtraction → SURVIVED
Covering tests

3.3
Location : renderArrayedValues
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 long multiplication with division → KILLED

340

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

347

1.1
Location : parseNoteLength
Killed by : com.github.dakusui.symfonion.tests.song.GrooveTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.song.GrooveTest]/[method:test_A01()]
negated conditional → KILLED

351

1.1
Location : parseNoteLength
Killed by : com.github.dakusui.symfonion.tests.song.GrooveTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.song.GrooveTest]/[method:test_A01()]
negated conditional → KILLED

2.2
Location : parseNoteLength
Killed by : com.github.dakusui.symfonion.tests.song.GrooveTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.song.GrooveTest]/[method:test_B02()]
changed conditional boundary → KILLED

352

1.1
Location : parseNoteLength
Killed by : com.github.dakusui.symfonion.tests.song.GrooveTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.song.GrooveTest]/[method:test_A04()]
Replaced integer multiplication with division → KILLED

355

1.1
Location : parseNoteLength
Killed by : com.github.dakusui.symfonion.tests.InvalidDataErrorTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.InvalidDataErrorTest]/[method:illegalNoteLength_02()]
negated conditional → KILLED

358

1.1
Location : parseNoteLength
Killed by : com.github.dakusui.symfonion.tests.song.GrooveTest.[engine:junit-jupiter]/[class:com.github.dakusui.symfonion.tests.song.GrooveTest]/[method:test_A01()]
replaced return value with null for com/github/dakusui/symfonion/song/PartMeasure::parseNoteLength → KILLED

363

1.1
Location : getIntArray
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

367

1.1
Location : getIntArray
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]
negated conditional → KILLED

374

1.1
Location : getIntArray
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/song/PartMeasure::getIntArray → KILLED

379

1.1
Location : expandDots
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]
changed conditional boundary → KILLED

2.2
Location : expandDots
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]
negated conditional → KILLED

381

1.1
Location : expandDots
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]
negated conditional → KILLED

383

1.1
Location : expandDots
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:#12]
negated conditional → KILLED

2.2
Location : expandDots
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 com/google/gson/JsonArray::add → KILLED

3.3
Location : expandDots
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]
negated conditional → KILLED

384

1.1
Location : expandDots
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:#12]
negated conditional → KILLED

386

1.1
Location : expandDots
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:#12]
negated conditional → KILLED

2.2
Location : expandDots
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:#12]
changed conditional boundary → KILLED

387

1.1
Location : expandDots
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:#12]
removed call to com/google/gson/JsonArray::add → KILLED

2.2
Location : expandDots
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:#12]
negated conditional → KILLED

391

1.1
Location : expandDots
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:#11]
removed call to com/google/gson/JsonArray::add → KILLED

2.2
Location : expandDots
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:#11]
negated conditional → KILLED

394

1.1
Location : expandDots
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/song/PartMeasure::expandDots → KILLED

400

1.1
Location : interpolate
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]
changed conditional boundary → KILLED

2.2
Location : interpolate
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]
negated conditional → KILLED

401

1.1
Location : interpolate
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]
negated conditional → KILLED

2.2
Location : interpolate
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]
negated conditional → KILLED

410

1.1
Location : interpolate
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]
changed conditional boundary → KILLED

2.2
Location : interpolate
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]
negated conditional → KILLED

411

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

414

1.1
Location : interpolate
Killed by : none
Replaced integer addition with subtraction → TIMED_OUT

415

1.1
Location : interpolate
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:#11]
negated conditional → KILLED

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

416

1.1
Location : interpolate
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:#11]
negated conditional → KILLED

423

1.1
Location : interpolate
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:#11]
Replaced integer division with multiplication → KILLED

2.2
Location : interpolate
Killed by : none
Replaced integer subtraction with addition → SURVIVED
Covering tests

3.3
Location : interpolate
Killed by : none
Replaced integer subtraction with addition → SURVIVED Covering tests

425

1.1
Location : interpolate
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

2.2
Location : interpolate
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:#11]
negated conditional → KILLED

426

1.1
Location : interpolate
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:#11]
Replaced integer addition with subtraction → KILLED

432

1.1
Location : interpolate
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/song/PartMeasure::interpolate → KILLED

446

1.1
Location : lambda$new$0
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/song/PartMeasure$StrokeSequence::lambda$new$0 → KILLED

449

1.1
Location : lambda$new$1
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/song/PartMeasure$StrokeSequence::lambda$new$1 → KILLED

451

1.1
Location : lambda$new$2
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/song/PartMeasure$StrokeSequence::lambda$new$2 → KILLED

454

1.1
Location : lambda$new$3
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/song/PartMeasure$StrokeSequence::lambda$new$3 → KILLED

Active mutators

Tests examined


Report generated by PIT 1.19.1