@Test public void shouldSelectCorectMean() { RhythmicAccents rhythmicAccentsOne = new RhythmicAccents(); rhythmicAccentsOne.setOneOne("10"); rhythmicAccentsOne.setOneTwo("8"); rhythmicAccentsOne.setOneThree("1"); rhythmicAccentsOne.setOneFour("0"); rhythmicAccentsOne.setTwoOne("0"); rhythmicAccentsOne.setTwoTwo("5"); rhythmicAccentsOne.setTwoThree("3"); rhythmicAccentsOne.setTwoFour("2"); rhythmicAccentsOne.setThreeOne("4"); rhythmicAccentsOne.setThreeTwo("6"); rhythmicAccentsOne.setThreeThree("1"); rhythmicAccentsOne.setThreeFour("0"); rhythmicAccentsOne.setFourOne("0"); rhythmicAccentsOne.setFourTwo("0"); rhythmicAccentsOne.setFourThree("3"); rhythmicAccentsOne.setFourFour("5"); assertThat(melodicGenerator.extractMeanfromAccents(rhythmicAccentsOne)).isEqualTo(3); }
public Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents) { Integer total = Integer.parseInt(rhythmicAccents.getOneOne()); total = total + Integer.parseInt(rhythmicAccents.getOneTwo()); total = total + Integer.parseInt(rhythmicAccents.getOneThree()); total = total + Integer.parseInt(rhythmicAccents.getOneFour()); total = total + Integer.parseInt(rhythmicAccents.getTwoOne()); total = total + Integer.parseInt(rhythmicAccents.getTwoTwo()); total = total + Integer.parseInt(rhythmicAccents.getTwoThree()); total = total + Integer.parseInt(rhythmicAccents.getTwoFour()); total = total + Integer.parseInt(rhythmicAccents.getThreeOne()); total = total + Integer.parseInt(rhythmicAccents.getThreeTwo()); total = total + Integer.parseInt(rhythmicAccents.getThreeThree()); total = total + Integer.parseInt(rhythmicAccents.getThreeFour()); total = total + Integer.parseInt(rhythmicAccents.getFourOne()); total = total + Integer.parseInt(rhythmicAccents.getFourTwo()); total = total + Integer.parseInt(rhythmicAccents.getFourThree()); total = total + Integer.parseInt(rhythmicAccents.getFourFour()); return total / 16; }
MelodicGenerator { public Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents) { Integer total = Integer.parseInt(rhythmicAccents.getOneOne()); total = total + Integer.parseInt(rhythmicAccents.getOneTwo()); total = total + Integer.parseInt(rhythmicAccents.getOneThree()); total = total + Integer.parseInt(rhythmicAccents.getOneFour()); total = total + Integer.parseInt(rhythmicAccents.getTwoOne()); total = total + Integer.parseInt(rhythmicAccents.getTwoTwo()); total = total + Integer.parseInt(rhythmicAccents.getTwoThree()); total = total + Integer.parseInt(rhythmicAccents.getTwoFour()); total = total + Integer.parseInt(rhythmicAccents.getThreeOne()); total = total + Integer.parseInt(rhythmicAccents.getThreeTwo()); total = total + Integer.parseInt(rhythmicAccents.getThreeThree()); total = total + Integer.parseInt(rhythmicAccents.getThreeFour()); total = total + Integer.parseInt(rhythmicAccents.getFourOne()); total = total + Integer.parseInt(rhythmicAccents.getFourTwo()); total = total + Integer.parseInt(rhythmicAccents.getFourThree()); total = total + Integer.parseInt(rhythmicAccents.getFourFour()); return total / 16; } }
MelodicGenerator { public Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents) { Integer total = Integer.parseInt(rhythmicAccents.getOneOne()); total = total + Integer.parseInt(rhythmicAccents.getOneTwo()); total = total + Integer.parseInt(rhythmicAccents.getOneThree()); total = total + Integer.parseInt(rhythmicAccents.getOneFour()); total = total + Integer.parseInt(rhythmicAccents.getTwoOne()); total = total + Integer.parseInt(rhythmicAccents.getTwoTwo()); total = total + Integer.parseInt(rhythmicAccents.getTwoThree()); total = total + Integer.parseInt(rhythmicAccents.getTwoFour()); total = total + Integer.parseInt(rhythmicAccents.getThreeOne()); total = total + Integer.parseInt(rhythmicAccents.getThreeTwo()); total = total + Integer.parseInt(rhythmicAccents.getThreeThree()); total = total + Integer.parseInt(rhythmicAccents.getThreeFour()); total = total + Integer.parseInt(rhythmicAccents.getFourOne()); total = total + Integer.parseInt(rhythmicAccents.getFourTwo()); total = total + Integer.parseInt(rhythmicAccents.getFourThree()); total = total + Integer.parseInt(rhythmicAccents.getFourFour()); return total / 16; }  }
MelodicGenerator { public Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents) { Integer total = Integer.parseInt(rhythmicAccents.getOneOne()); total = total + Integer.parseInt(rhythmicAccents.getOneTwo()); total = total + Integer.parseInt(rhythmicAccents.getOneThree()); total = total + Integer.parseInt(rhythmicAccents.getOneFour()); total = total + Integer.parseInt(rhythmicAccents.getTwoOne()); total = total + Integer.parseInt(rhythmicAccents.getTwoTwo()); total = total + Integer.parseInt(rhythmicAccents.getTwoThree()); total = total + Integer.parseInt(rhythmicAccents.getTwoFour()); total = total + Integer.parseInt(rhythmicAccents.getThreeOne()); total = total + Integer.parseInt(rhythmicAccents.getThreeTwo()); total = total + Integer.parseInt(rhythmicAccents.getThreeThree()); total = total + Integer.parseInt(rhythmicAccents.getThreeFour()); total = total + Integer.parseInt(rhythmicAccents.getFourOne()); total = total + Integer.parseInt(rhythmicAccents.getFourTwo()); total = total + Integer.parseInt(rhythmicAccents.getFourThree()); total = total + Integer.parseInt(rhythmicAccents.getFourFour()); return total / 16; }  QueueState setMelodicPositions(QueueState queueState); RhythmicAccents getHarmonicLoopAltBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents getHarmonicLoopBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents getBeatLoopAltBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents getBeatLoopBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents); RhythmicAccents setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean); Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents); Map<ProgressionType, List<HarmonyExtraction>> createTypeToExtractionMap(QueueState queueState); }
MelodicGenerator { public Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents) { Integer total = Integer.parseInt(rhythmicAccents.getOneOne()); total = total + Integer.parseInt(rhythmicAccents.getOneTwo()); total = total + Integer.parseInt(rhythmicAccents.getOneThree()); total = total + Integer.parseInt(rhythmicAccents.getOneFour()); total = total + Integer.parseInt(rhythmicAccents.getTwoOne()); total = total + Integer.parseInt(rhythmicAccents.getTwoTwo()); total = total + Integer.parseInt(rhythmicAccents.getTwoThree()); total = total + Integer.parseInt(rhythmicAccents.getTwoFour()); total = total + Integer.parseInt(rhythmicAccents.getThreeOne()); total = total + Integer.parseInt(rhythmicAccents.getThreeTwo()); total = total + Integer.parseInt(rhythmicAccents.getThreeThree()); total = total + Integer.parseInt(rhythmicAccents.getThreeFour()); total = total + Integer.parseInt(rhythmicAccents.getFourOne()); total = total + Integer.parseInt(rhythmicAccents.getFourTwo()); total = total + Integer.parseInt(rhythmicAccents.getFourThree()); total = total + Integer.parseInt(rhythmicAccents.getFourFour()); return total / 16; }  QueueState setMelodicPositions(QueueState queueState); RhythmicAccents getHarmonicLoopAltBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents getHarmonicLoopBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents getBeatLoopAltBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents getBeatLoopBarAccents(ProgressionUnitBar pBar, int barPosition); RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents); RhythmicAccents setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean); Integer extractMeanfromAccents(RhythmicAccents rhythmicAccents); Map<ProgressionType, List<HarmonyExtraction>> createTypeToExtractionMap(QueueState queueState);  }