Program: 39162
Project: 39162
Buggy source:
/** 
 * Takes in data of frequencies, lengths, and starting times of an audio file and  reconstructs the file as a single playable amplitude array that uses a generated CPPN as the instrument.
 * @param audio Original MIDI file
 * @param midiLists ArrayList containing ArrayLists with the file's frequencies, lengths, and start times of all notes
 * @param cppn input CPPN used to play back reconstructed audio
 * @return playable double array of amplitudes
 */
public static double[] lineToAmplitudeArray(String audio,ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists,Network cppn,double noteLengthScale){
  File audioFile=new File(audio);
  try {
    Sequence sequence=MidiSystem.getSequence(audioFile);
    double amplitudeLengthMultiplier=PlayDoubleArray.DEFAULT_AUDIO_FORMAT.getFrameRate() / (sequence.getMicrosecondLength() / sequence.getTickLength());
    amplitudeLengthMultiplier*=noteLengthScale;
    amplitudeLengthMultiplier=Math.ceil(amplitudeLengthMultiplier);
    System.out.println("String_Node_Str" + amplitudeLengthMultiplier);
    long totalTicks=0;
    for (int i=0; i < midiLists.size(); i++) {
      long lineTicks=midiLists.get(i).t3.get(midiLists.get(i).t3.size() - 1) + midiLists.get(i).t2.get(midiLists.get(i).t2.size() - 1);
      System.out.println("String_Node_Str" + lineTicks);
      System.out.println("String_Node_Str" + totalTicks);
      totalTicks=Math.max(totalTicks,lineTicks);
    }
    double[] amplitudeArray=new double[(int)(amplitudeLengthMultiplier * totalTicks)];
    for (int k=0; k < midiLists.size(); k++) {
      for (int i=0; i < midiLists.get(k).t1.size(); i++) {
        int amplitudeLength=(int)(amplitudeLengthMultiplier * midiLists.get(k).t2.get(i));
        double[] amplitude=SoundFromCPPNUtil.amplitudeGenerator(cppn,amplitudeLength,midiLists.get(k).t1.get(i));
        int start=(int)(amplitudeLengthMultiplier * midiLists.get(k).t3.get(i));
        for (int j=0; j < amplitude.length; j++) {
          amplitudeArray[start + j]+=amplitude[j];
        }
      }
    }
    for (int i=0; i < amplitudeArray.length; i++) {
      amplitudeArray[i]/=2;
    }
    return amplitudeArray;
  }
 catch (  InvalidMidiDataException|IOException e) {
    e.printStackTrace();
    System.exit(1);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Takes in data of frequencies, lengths, and starting times of an audio file and  reconstructs the file as a single playable amplitude array that uses a generated CPPN as the instrument.
 * @param audio Original MIDI file
 * @param midiLists ArrayList containing ArrayLists with the file's frequencies, lengths, and start times of all notes
 * @param cppn input CPPN used to play back reconstructed audio
 * @return playable double array of amplitudes
 */
public static double[] lineToAmplitudeArray(String audio,ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists,Network cppn,double noteLengthScale){
  File audioFile=new File(audio);
  try {
    Sequence sequence=MidiSystem.getSequence(audioFile);
    Track[] tracks=sequence.getTracks();
    int longestTrack=0;
    for (int i=0; i < tracks.length; i++) {
      longestTrack=Math.max(longestTrack,tracks[i].size());
    }
    System.out.println("String_Node_Str" + longestTrack);
    double amplitudeLengthMultiplier=getAmplitudeLengthMultiplier(audio);
    System.out.println("String_Node_Str" + midiLists.size());
    amplitudeLengthMultiplier*=noteLengthScale;
    amplitudeLengthMultiplier=Math.ceil(amplitudeLengthMultiplier);
    System.out.println("String_Node_Str" + amplitudeLengthMultiplier);
    long totalTicks=0;
    for (int i=0; i < midiLists.size(); i++) {
      long lineTicks=midiLists.get(i).t3.get(midiLists.get(i).t3.size() - 1) + midiLists.get(i).t2.get(midiLists.get(i).t2.size() - 1);
      System.out.println("String_Node_Str" + lineTicks);
      System.out.println("String_Node_Str" + totalTicks);
      totalTicks=Math.max(totalTicks,lineTicks);
    }
    double[] amplitudeArray=new double[(int)(amplitudeLengthMultiplier * totalTicks)];
    for (int k=0; k < midiLists.size(); k++) {
      for (int i=0; i < midiLists.get(k).t1.size(); i++) {
        int amplitudeLength=(int)(amplitudeLengthMultiplier * midiLists.get(k).t2.get(i));
        double[] amplitude=SoundFromCPPNUtil.amplitudeGenerator(cppn,amplitudeLength,midiLists.get(k).t1.get(i));
        int start=(int)(amplitudeLengthMultiplier * midiLists.get(k).t3.get(i));
        for (int j=0; j < amplitude.length; j++) {
          amplitudeArray[start + j]+=amplitude[j];
        }
      }
    }
    for (int i=0; i < amplitudeArray.length; i++) {
      amplitudeArray[i]/=midiLists.size();
    }
    return amplitudeArray;
  }
 catch (  InvalidMidiDataException|IOException e) {
    e.printStackTrace();
    System.exit(1);
  }
  return null;
}