@Test public void shouldSumAccentsCorrectly() { RhythmicAccents rhythmicAccentsOne = new RhythmicAccents(); rhythmicAccentsOne.setOneOne("1"); rhythmicAccentsOne.setOneTwo("1"); rhythmicAccentsOne.setOneThree("1"); rhythmicAccentsOne.setOneFour("1"); rhythmicAccentsOne.setTwoOne("0"); rhythmicAccentsOne.setTwoTwo("0"); rhythmicAccentsOne.setTwoThree("0"); rhythmicAccentsOne.setTwoFour("0"); rhythmicAccentsOne.setThreeOne("0"); rhythmicAccentsOne.setThreeTwo("0"); rhythmicAccentsOne.setThreeThree("0"); rhythmicAccentsOne.setThreeFour("0"); rhythmicAccentsOne.setFourOne("0"); rhythmicAccentsOne.setFourTwo("0"); rhythmicAccentsOne.setFourThree("0"); rhythmicAccentsOne.setFourFour("0"); RhythmicAccents rhythmicAccentsTwo = new RhythmicAccents(); rhythmicAccentsTwo.setOneOne("1"); rhythmicAccentsTwo.setOneTwo("1"); rhythmicAccentsTwo.setOneThree("1"); rhythmicAccentsTwo.setOneFour("1"); rhythmicAccentsTwo.setTwoOne("1"); rhythmicAccentsTwo.setTwoTwo("1"); rhythmicAccentsTwo.setTwoThree("1"); rhythmicAccentsTwo.setTwoFour("1"); rhythmicAccentsTwo.setThreeOne("0"); rhythmicAccentsTwo.setThreeTwo("0"); rhythmicAccentsTwo.setThreeThree("0"); rhythmicAccentsTwo.setThreeFour("0"); rhythmicAccentsTwo.setFourOne("0"); rhythmicAccentsTwo.setFourTwo("0"); rhythmicAccentsTwo.setFourThree("0"); rhythmicAccentsTwo.setFourFour("0"); RhythmicAccents rhythmicAccentsThree = new RhythmicAccents(); rhythmicAccentsThree.setOneOne("1"); rhythmicAccentsThree.setOneTwo("1"); rhythmicAccentsThree.setOneThree("1"); rhythmicAccentsThree.setOneFour("1"); rhythmicAccentsThree.setTwoOne("1"); rhythmicAccentsThree.setTwoTwo("1"); rhythmicAccentsThree.setTwoThree("1"); rhythmicAccentsThree.setTwoFour("1"); rhythmicAccentsThree.setThreeOne("1"); rhythmicAccentsThree.setThreeTwo("1"); rhythmicAccentsThree.setThreeThree("1"); rhythmicAccentsThree.setThreeFour("1"); rhythmicAccentsThree.setFourOne("0"); rhythmicAccentsThree.setFourTwo("0"); rhythmicAccentsThree.setFourThree("0"); rhythmicAccentsThree.setFourFour("0"); RhythmicAccents rhythmicAccentsFour = new RhythmicAccents(); rhythmicAccentsFour.setOneOne("1"); rhythmicAccentsFour.setOneTwo("1"); rhythmicAccentsFour.setOneThree("1"); rhythmicAccentsFour.setOneFour("1"); rhythmicAccentsFour.setTwoOne("1"); rhythmicAccentsFour.setTwoTwo("1"); rhythmicAccentsFour.setTwoThree("1"); rhythmicAccentsFour.setTwoFour("1"); rhythmicAccentsFour.setThreeOne("1"); rhythmicAccentsFour.setThreeTwo("1"); rhythmicAccentsFour.setThreeThree("1"); rhythmicAccentsFour.setThreeFour("1"); rhythmicAccentsFour.setFourOne("1"); rhythmicAccentsFour.setFourTwo("1"); rhythmicAccentsFour.setFourThree("1"); rhythmicAccentsFour.setFourFour("1"); RhythmicAccents summedAccents = melodicGenerator.sumRhythmicAccents(Arrays.asList(rhythmicAccentsOne, rhythmicAccentsTwo, rhythmicAccentsThree, rhythmicAccentsFour)); assertThat(summedAccents.getOneOne()).isEqualToIgnoringCase("4"); assertThat(summedAccents.getOneTwo()).isEqualToIgnoringCase("4"); assertThat(summedAccents.getOneThree()).isEqualToIgnoringCase("4"); assertThat(summedAccents.getOneFour()).isEqualToIgnoringCase("4"); assertThat(summedAccents.getTwoOne()).isEqualToIgnoringCase("3"); assertThat(summedAccents.getTwoTwo()).isEqualToIgnoringCase("3"); assertThat(summedAccents.getTwoThree()).isEqualToIgnoringCase("3"); assertThat(summedAccents.getTwoFour()).isEqualToIgnoringCase("3"); assertThat(summedAccents.getThreeOne()).isEqualToIgnoringCase("2"); assertThat(summedAccents.getThreeTwo()).isEqualToIgnoringCase("2"); assertThat(summedAccents.getThreeThree()).isEqualToIgnoringCase("2"); assertThat(summedAccents.getThreeFour()).isEqualToIgnoringCase("2"); assertThat(summedAccents.getFourOne()).isEqualToIgnoringCase("1"); assertThat(summedAccents.getFourTwo()).isEqualToIgnoringCase("1"); assertThat(summedAccents.getFourThree()).isEqualToIgnoringCase("1"); assertThat(summedAccents.getFourFour()).isEqualToIgnoringCase("1"); }
public RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents) { RhythmicAccents accentSum = new RhythmicAccents(); for (RhythmicAccents accent : accents) { accentSum.setOneOne(Integer.toString(Integer.parseInt(accentSum.getOneOne()) + Integer.parseInt(accent.getOneOne()))); accentSum.setOneTwo(Integer.toString(Integer.parseInt(accentSum.getOneTwo()) + Integer.parseInt(accent.getOneTwo()))); accentSum.setOneThree(Integer.toString(Integer.parseInt(accentSum.getOneThree()) + Integer.parseInt(accent.getOneThree()))); accentSum.setOneFour(Integer.toString(Integer.parseInt(accentSum.getOneFour()) + Integer.parseInt(accent.getOneFour()))); accentSum.setTwoOne(Integer.toString(Integer.parseInt(accentSum.getTwoOne()) + Integer.parseInt(accent.getTwoOne()))); accentSum.setTwoTwo(Integer.toString(Integer.parseInt(accentSum.getTwoTwo()) + Integer.parseInt(accent.getTwoTwo()))); accentSum.setTwoThree(Integer.toString(Integer.parseInt(accentSum.getTwoThree()) + Integer.parseInt(accent.getTwoThree()))); accentSum.setTwoFour(Integer.toString(Integer.parseInt(accentSum.getTwoFour()) + Integer.parseInt(accent.getTwoFour()))); accentSum.setThreeOne(Integer.toString(Integer.parseInt(accentSum.getThreeOne()) + Integer.parseInt(accent.getThreeOne()))); accentSum.setThreeTwo(Integer.toString(Integer.parseInt(accentSum.getThreeTwo()) + Integer.parseInt(accent.getThreeTwo()))); accentSum.setThreeThree(Integer.toString(Integer.parseInt(accentSum.getThreeThree()) + Integer.parseInt(accent.getThreeThree()))); accentSum.setThreeFour(Integer.toString(Integer.parseInt(accentSum.getThreeFour()) + Integer.parseInt(accent.getThreeFour()))); accentSum.setFourOne(Integer.toString(Integer.parseInt(accentSum.getFourOne()) + Integer.parseInt(accent.getFourOne()))); accentSum.setFourTwo(Integer.toString(Integer.parseInt(accentSum.getFourTwo()) + Integer.parseInt(accent.getFourTwo()))); accentSum.setFourThree(Integer.toString(Integer.parseInt(accentSum.getFourThree()) + Integer.parseInt(accent.getFourThree()))); accentSum.setFourFour(Integer.toString(Integer.parseInt(accentSum.getFourFour()) + Integer.parseInt(accent.getFourFour()))); } return accentSum; }
MelodicGenerator { public RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents) { RhythmicAccents accentSum = new RhythmicAccents(); for (RhythmicAccents accent : accents) { accentSum.setOneOne(Integer.toString(Integer.parseInt(accentSum.getOneOne()) + Integer.parseInt(accent.getOneOne()))); accentSum.setOneTwo(Integer.toString(Integer.parseInt(accentSum.getOneTwo()) + Integer.parseInt(accent.getOneTwo()))); accentSum.setOneThree(Integer.toString(Integer.parseInt(accentSum.getOneThree()) + Integer.parseInt(accent.getOneThree()))); accentSum.setOneFour(Integer.toString(Integer.parseInt(accentSum.getOneFour()) + Integer.parseInt(accent.getOneFour()))); accentSum.setTwoOne(Integer.toString(Integer.parseInt(accentSum.getTwoOne()) + Integer.parseInt(accent.getTwoOne()))); accentSum.setTwoTwo(Integer.toString(Integer.parseInt(accentSum.getTwoTwo()) + Integer.parseInt(accent.getTwoTwo()))); accentSum.setTwoThree(Integer.toString(Integer.parseInt(accentSum.getTwoThree()) + Integer.parseInt(accent.getTwoThree()))); accentSum.setTwoFour(Integer.toString(Integer.parseInt(accentSum.getTwoFour()) + Integer.parseInt(accent.getTwoFour()))); accentSum.setThreeOne(Integer.toString(Integer.parseInt(accentSum.getThreeOne()) + Integer.parseInt(accent.getThreeOne()))); accentSum.setThreeTwo(Integer.toString(Integer.parseInt(accentSum.getThreeTwo()) + Integer.parseInt(accent.getThreeTwo()))); accentSum.setThreeThree(Integer.toString(Integer.parseInt(accentSum.getThreeThree()) + Integer.parseInt(accent.getThreeThree()))); accentSum.setThreeFour(Integer.toString(Integer.parseInt(accentSum.getThreeFour()) + Integer.parseInt(accent.getThreeFour()))); accentSum.setFourOne(Integer.toString(Integer.parseInt(accentSum.getFourOne()) + Integer.parseInt(accent.getFourOne()))); accentSum.setFourTwo(Integer.toString(Integer.parseInt(accentSum.getFourTwo()) + Integer.parseInt(accent.getFourTwo()))); accentSum.setFourThree(Integer.toString(Integer.parseInt(accentSum.getFourThree()) + Integer.parseInt(accent.getFourThree()))); accentSum.setFourFour(Integer.toString(Integer.parseInt(accentSum.getFourFour()) + Integer.parseInt(accent.getFourFour()))); } return accentSum; } }
MelodicGenerator { public RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents) { RhythmicAccents accentSum = new RhythmicAccents(); for (RhythmicAccents accent : accents) { accentSum.setOneOne(Integer.toString(Integer.parseInt(accentSum.getOneOne()) + Integer.parseInt(accent.getOneOne()))); accentSum.setOneTwo(Integer.toString(Integer.parseInt(accentSum.getOneTwo()) + Integer.parseInt(accent.getOneTwo()))); accentSum.setOneThree(Integer.toString(Integer.parseInt(accentSum.getOneThree()) + Integer.parseInt(accent.getOneThree()))); accentSum.setOneFour(Integer.toString(Integer.parseInt(accentSum.getOneFour()) + Integer.parseInt(accent.getOneFour()))); accentSum.setTwoOne(Integer.toString(Integer.parseInt(accentSum.getTwoOne()) + Integer.parseInt(accent.getTwoOne()))); accentSum.setTwoTwo(Integer.toString(Integer.parseInt(accentSum.getTwoTwo()) + Integer.parseInt(accent.getTwoTwo()))); accentSum.setTwoThree(Integer.toString(Integer.parseInt(accentSum.getTwoThree()) + Integer.parseInt(accent.getTwoThree()))); accentSum.setTwoFour(Integer.toString(Integer.parseInt(accentSum.getTwoFour()) + Integer.parseInt(accent.getTwoFour()))); accentSum.setThreeOne(Integer.toString(Integer.parseInt(accentSum.getThreeOne()) + Integer.parseInt(accent.getThreeOne()))); accentSum.setThreeTwo(Integer.toString(Integer.parseInt(accentSum.getThreeTwo()) + Integer.parseInt(accent.getThreeTwo()))); accentSum.setThreeThree(Integer.toString(Integer.parseInt(accentSum.getThreeThree()) + Integer.parseInt(accent.getThreeThree()))); accentSum.setThreeFour(Integer.toString(Integer.parseInt(accentSum.getThreeFour()) + Integer.parseInt(accent.getThreeFour()))); accentSum.setFourOne(Integer.toString(Integer.parseInt(accentSum.getFourOne()) + Integer.parseInt(accent.getFourOne()))); accentSum.setFourTwo(Integer.toString(Integer.parseInt(accentSum.getFourTwo()) + Integer.parseInt(accent.getFourTwo()))); accentSum.setFourThree(Integer.toString(Integer.parseInt(accentSum.getFourThree()) + Integer.parseInt(accent.getFourThree()))); accentSum.setFourFour(Integer.toString(Integer.parseInt(accentSum.getFourFour()) + Integer.parseInt(accent.getFourFour()))); } return accentSum; }  }
MelodicGenerator { public RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents) { RhythmicAccents accentSum = new RhythmicAccents(); for (RhythmicAccents accent : accents) { accentSum.setOneOne(Integer.toString(Integer.parseInt(accentSum.getOneOne()) + Integer.parseInt(accent.getOneOne()))); accentSum.setOneTwo(Integer.toString(Integer.parseInt(accentSum.getOneTwo()) + Integer.parseInt(accent.getOneTwo()))); accentSum.setOneThree(Integer.toString(Integer.parseInt(accentSum.getOneThree()) + Integer.parseInt(accent.getOneThree()))); accentSum.setOneFour(Integer.toString(Integer.parseInt(accentSum.getOneFour()) + Integer.parseInt(accent.getOneFour()))); accentSum.setTwoOne(Integer.toString(Integer.parseInt(accentSum.getTwoOne()) + Integer.parseInt(accent.getTwoOne()))); accentSum.setTwoTwo(Integer.toString(Integer.parseInt(accentSum.getTwoTwo()) + Integer.parseInt(accent.getTwoTwo()))); accentSum.setTwoThree(Integer.toString(Integer.parseInt(accentSum.getTwoThree()) + Integer.parseInt(accent.getTwoThree()))); accentSum.setTwoFour(Integer.toString(Integer.parseInt(accentSum.getTwoFour()) + Integer.parseInt(accent.getTwoFour()))); accentSum.setThreeOne(Integer.toString(Integer.parseInt(accentSum.getThreeOne()) + Integer.parseInt(accent.getThreeOne()))); accentSum.setThreeTwo(Integer.toString(Integer.parseInt(accentSum.getThreeTwo()) + Integer.parseInt(accent.getThreeTwo()))); accentSum.setThreeThree(Integer.toString(Integer.parseInt(accentSum.getThreeThree()) + Integer.parseInt(accent.getThreeThree()))); accentSum.setThreeFour(Integer.toString(Integer.parseInt(accentSum.getThreeFour()) + Integer.parseInt(accent.getThreeFour()))); accentSum.setFourOne(Integer.toString(Integer.parseInt(accentSum.getFourOne()) + Integer.parseInt(accent.getFourOne()))); accentSum.setFourTwo(Integer.toString(Integer.parseInt(accentSum.getFourTwo()) + Integer.parseInt(accent.getFourTwo()))); accentSum.setFourThree(Integer.toString(Integer.parseInt(accentSum.getFourThree()) + Integer.parseInt(accent.getFourThree()))); accentSum.setFourFour(Integer.toString(Integer.parseInt(accentSum.getFourFour()) + Integer.parseInt(accent.getFourFour()))); } return accentSum; }  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 RhythmicAccents sumRhythmicAccents(List<RhythmicAccents> accents) { RhythmicAccents accentSum = new RhythmicAccents(); for (RhythmicAccents accent : accents) { accentSum.setOneOne(Integer.toString(Integer.parseInt(accentSum.getOneOne()) + Integer.parseInt(accent.getOneOne()))); accentSum.setOneTwo(Integer.toString(Integer.parseInt(accentSum.getOneTwo()) + Integer.parseInt(accent.getOneTwo()))); accentSum.setOneThree(Integer.toString(Integer.parseInt(accentSum.getOneThree()) + Integer.parseInt(accent.getOneThree()))); accentSum.setOneFour(Integer.toString(Integer.parseInt(accentSum.getOneFour()) + Integer.parseInt(accent.getOneFour()))); accentSum.setTwoOne(Integer.toString(Integer.parseInt(accentSum.getTwoOne()) + Integer.parseInt(accent.getTwoOne()))); accentSum.setTwoTwo(Integer.toString(Integer.parseInt(accentSum.getTwoTwo()) + Integer.parseInt(accent.getTwoTwo()))); accentSum.setTwoThree(Integer.toString(Integer.parseInt(accentSum.getTwoThree()) + Integer.parseInt(accent.getTwoThree()))); accentSum.setTwoFour(Integer.toString(Integer.parseInt(accentSum.getTwoFour()) + Integer.parseInt(accent.getTwoFour()))); accentSum.setThreeOne(Integer.toString(Integer.parseInt(accentSum.getThreeOne()) + Integer.parseInt(accent.getThreeOne()))); accentSum.setThreeTwo(Integer.toString(Integer.parseInt(accentSum.getThreeTwo()) + Integer.parseInt(accent.getThreeTwo()))); accentSum.setThreeThree(Integer.toString(Integer.parseInt(accentSum.getThreeThree()) + Integer.parseInt(accent.getThreeThree()))); accentSum.setThreeFour(Integer.toString(Integer.parseInt(accentSum.getThreeFour()) + Integer.parseInt(accent.getThreeFour()))); accentSum.setFourOne(Integer.toString(Integer.parseInt(accentSum.getFourOne()) + Integer.parseInt(accent.getFourOne()))); accentSum.setFourTwo(Integer.toString(Integer.parseInt(accentSum.getFourTwo()) + Integer.parseInt(accent.getFourTwo()))); accentSum.setFourThree(Integer.toString(Integer.parseInt(accentSum.getFourThree()) + Integer.parseInt(accent.getFourThree()))); accentSum.setFourFour(Integer.toString(Integer.parseInt(accentSum.getFourFour()) + Integer.parseInt(accent.getFourFour()))); } return accentSum; }  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);  }