@Test public void shouldSelectHigherThatMeanAsAccents() { 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"); int mean = 3; RhythmicAccents accents = melodicGenerator.setAccentsAboveMean(rhythmicAccentsOne, 3); assertThat(accents.getOneOne()).isEqualTo("1"); assertThat(accents.getOneTwo()).isEqualTo("1"); assertThat(accents.getOneThree()).isEqualTo("0"); assertThat(accents.getOneFour()).isEqualTo("0"); assertThat(accents.getTwoOne()).isEqualTo("0"); assertThat(accents.getTwoTwo()).isEqualTo("1"); assertThat(accents.getTwoThree()).isEqualTo("0"); assertThat(accents.getTwoFour()).isEqualTo("0"); assertThat(accents.getThreeOne()).isEqualTo("1"); assertThat(accents.getThreeTwo()).isEqualTo("1"); assertThat(accents.getThreeThree()).isEqualTo("0"); assertThat(accents.getThreeFour()).isEqualTo("0"); assertThat(accents.getFourOne()).isEqualTo("0"); assertThat(accents.getFourTwo()).isEqualTo("0"); assertThat(accents.getFourThree()).isEqualTo("0"); assertThat(accents.getFourFour()).isEqualTo("1"); }
public RhythmicAccents setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean) { RhythmicAccents accentsAboveMean = new RhythmicAccents(); if (Integer.parseInt(rhythmicAccents.getOneOne()) > mean) { accentsAboveMean.setOneOne("1"); } else { accentsAboveMean.setOneOne("0"); } if (Integer.parseInt(rhythmicAccents.getOneTwo()) > mean) { accentsAboveMean.setOneTwo("1"); } else { accentsAboveMean.setOneTwo("0"); } if (Integer.parseInt(rhythmicAccents.getOneThree()) > mean) { accentsAboveMean.setOneThree("1"); } else { accentsAboveMean.setOneThree("0"); } if (Integer.parseInt(rhythmicAccents.getOneFour()) > mean) { accentsAboveMean.setOneFour("1"); } else { accentsAboveMean.setOneFour("0"); } if (Integer.parseInt(rhythmicAccents.getTwoOne()) > mean) { accentsAboveMean.setTwoOne("1"); } else { accentsAboveMean.setTwoOne("0"); } if (Integer.parseInt(rhythmicAccents.getTwoTwo()) > mean) { accentsAboveMean.setTwoTwo("1"); } else { accentsAboveMean.setTwoTwo("0"); } if (Integer.parseInt(rhythmicAccents.getTwoThree()) > mean) { accentsAboveMean.setTwoThree("1"); } else { accentsAboveMean.setTwoThree("0"); } if (Integer.parseInt(rhythmicAccents.getTwoFour()) > mean) { accentsAboveMean.setTwoFour("1"); } else { accentsAboveMean.setTwoFour("0"); } if (Integer.parseInt(rhythmicAccents.getThreeOne()) > mean) { accentsAboveMean.setThreeOne("1"); } else { accentsAboveMean.setThreeOne("0"); } if (Integer.parseInt(rhythmicAccents.getThreeTwo()) > mean) { accentsAboveMean.setThreeTwo("1"); } else { accentsAboveMean.setThreeTwo("0"); } if (Integer.parseInt(rhythmicAccents.getThreeThree()) > mean) { accentsAboveMean.setThreeThree("1"); } else { accentsAboveMean.setThreeThree("0"); } if (Integer.parseInt(rhythmicAccents.getThreeFour()) > mean) { accentsAboveMean.setThreeFour("1"); } else { accentsAboveMean.setThreeFour("0"); } if (Integer.parseInt(rhythmicAccents.getFourOne()) > mean) { accentsAboveMean.setFourOne("1"); } else { accentsAboveMean.setFourOne("0"); } if (Integer.parseInt(rhythmicAccents.getFourTwo()) > mean) { accentsAboveMean.setFourTwo("1"); } else { accentsAboveMean.setFourTwo("0"); } if (Integer.parseInt(rhythmicAccents.getFourThree()) > mean) { accentsAboveMean.setFourThree("1"); } else { accentsAboveMean.setFourThree("0"); } if (Integer.parseInt(rhythmicAccents.getFourFour()) > mean) { accentsAboveMean.setFourFour("1"); } else { accentsAboveMean.setFourFour("0"); } return accentsAboveMean; }
MelodicGenerator { public RhythmicAccents setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean) { RhythmicAccents accentsAboveMean = new RhythmicAccents(); if (Integer.parseInt(rhythmicAccents.getOneOne()) > mean) { accentsAboveMean.setOneOne("1"); } else { accentsAboveMean.setOneOne("0"); } if (Integer.parseInt(rhythmicAccents.getOneTwo()) > mean) { accentsAboveMean.setOneTwo("1"); } else { accentsAboveMean.setOneTwo("0"); } if (Integer.parseInt(rhythmicAccents.getOneThree()) > mean) { accentsAboveMean.setOneThree("1"); } else { accentsAboveMean.setOneThree("0"); } if (Integer.parseInt(rhythmicAccents.getOneFour()) > mean) { accentsAboveMean.setOneFour("1"); } else { accentsAboveMean.setOneFour("0"); } if (Integer.parseInt(rhythmicAccents.getTwoOne()) > mean) { accentsAboveMean.setTwoOne("1"); } else { accentsAboveMean.setTwoOne("0"); } if (Integer.parseInt(rhythmicAccents.getTwoTwo()) > mean) { accentsAboveMean.setTwoTwo("1"); } else { accentsAboveMean.setTwoTwo("0"); } if (Integer.parseInt(rhythmicAccents.getTwoThree()) > mean) { accentsAboveMean.setTwoThree("1"); } else { accentsAboveMean.setTwoThree("0"); } if (Integer.parseInt(rhythmicAccents.getTwoFour()) > mean) { accentsAboveMean.setTwoFour("1"); } else { accentsAboveMean.setTwoFour("0"); } if (Integer.parseInt(rhythmicAccents.getThreeOne()) > mean) { accentsAboveMean.setThreeOne("1"); } else { accentsAboveMean.setThreeOne("0"); } if (Integer.parseInt(rhythmicAccents.getThreeTwo()) > mean) { accentsAboveMean.setThreeTwo("1"); } else { accentsAboveMean.setThreeTwo("0"); } if (Integer.parseInt(rhythmicAccents.getThreeThree()) > mean) { accentsAboveMean.setThreeThree("1"); } else { accentsAboveMean.setThreeThree("0"); } if (Integer.parseInt(rhythmicAccents.getThreeFour()) > mean) { accentsAboveMean.setThreeFour("1"); } else { accentsAboveMean.setThreeFour("0"); } if (Integer.parseInt(rhythmicAccents.getFourOne()) > mean) { accentsAboveMean.setFourOne("1"); } else { accentsAboveMean.setFourOne("0"); } if (Integer.parseInt(rhythmicAccents.getFourTwo()) > mean) { accentsAboveMean.setFourTwo("1"); } else { accentsAboveMean.setFourTwo("0"); } if (Integer.parseInt(rhythmicAccents.getFourThree()) > mean) { accentsAboveMean.setFourThree("1"); } else { accentsAboveMean.setFourThree("0"); } if (Integer.parseInt(rhythmicAccents.getFourFour()) > mean) { accentsAboveMean.setFourFour("1"); } else { accentsAboveMean.setFourFour("0"); } return accentsAboveMean; } }
MelodicGenerator { public RhythmicAccents setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean) { RhythmicAccents accentsAboveMean = new RhythmicAccents(); if (Integer.parseInt(rhythmicAccents.getOneOne()) > mean) { accentsAboveMean.setOneOne("1"); } else { accentsAboveMean.setOneOne("0"); } if (Integer.parseInt(rhythmicAccents.getOneTwo()) > mean) { accentsAboveMean.setOneTwo("1"); } else { accentsAboveMean.setOneTwo("0"); } if (Integer.parseInt(rhythmicAccents.getOneThree()) > mean) { accentsAboveMean.setOneThree("1"); } else { accentsAboveMean.setOneThree("0"); } if (Integer.parseInt(rhythmicAccents.getOneFour()) > mean) { accentsAboveMean.setOneFour("1"); } else { accentsAboveMean.setOneFour("0"); } if (Integer.parseInt(rhythmicAccents.getTwoOne()) > mean) { accentsAboveMean.setTwoOne("1"); } else { accentsAboveMean.setTwoOne("0"); } if (Integer.parseInt(rhythmicAccents.getTwoTwo()) > mean) { accentsAboveMean.setTwoTwo("1"); } else { accentsAboveMean.setTwoTwo("0"); } if (Integer.parseInt(rhythmicAccents.getTwoThree()) > mean) { accentsAboveMean.setTwoThree("1"); } else { accentsAboveMean.setTwoThree("0"); } if (Integer.parseInt(rhythmicAccents.getTwoFour()) > mean) { accentsAboveMean.setTwoFour("1"); } else { accentsAboveMean.setTwoFour("0"); } if (Integer.parseInt(rhythmicAccents.getThreeOne()) > mean) { accentsAboveMean.setThreeOne("1"); } else { accentsAboveMean.setThreeOne("0"); } if (Integer.parseInt(rhythmicAccents.getThreeTwo()) > mean) { accentsAboveMean.setThreeTwo("1"); } else { accentsAboveMean.setThreeTwo("0"); } if (Integer.parseInt(rhythmicAccents.getThreeThree()) > mean) { accentsAboveMean.setThreeThree("1"); } else { accentsAboveMean.setThreeThree("0"); } if (Integer.parseInt(rhythmicAccents.getThreeFour()) > mean) { accentsAboveMean.setThreeFour("1"); } else { accentsAboveMean.setThreeFour("0"); } if (Integer.parseInt(rhythmicAccents.getFourOne()) > mean) { accentsAboveMean.setFourOne("1"); } else { accentsAboveMean.setFourOne("0"); } if (Integer.parseInt(rhythmicAccents.getFourTwo()) > mean) { accentsAboveMean.setFourTwo("1"); } else { accentsAboveMean.setFourTwo("0"); } if (Integer.parseInt(rhythmicAccents.getFourThree()) > mean) { accentsAboveMean.setFourThree("1"); } else { accentsAboveMean.setFourThree("0"); } if (Integer.parseInt(rhythmicAccents.getFourFour()) > mean) { accentsAboveMean.setFourFour("1"); } else { accentsAboveMean.setFourFour("0"); } return accentsAboveMean; }  }
MelodicGenerator { public RhythmicAccents setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean) { RhythmicAccents accentsAboveMean = new RhythmicAccents(); if (Integer.parseInt(rhythmicAccents.getOneOne()) > mean) { accentsAboveMean.setOneOne("1"); } else { accentsAboveMean.setOneOne("0"); } if (Integer.parseInt(rhythmicAccents.getOneTwo()) > mean) { accentsAboveMean.setOneTwo("1"); } else { accentsAboveMean.setOneTwo("0"); } if (Integer.parseInt(rhythmicAccents.getOneThree()) > mean) { accentsAboveMean.setOneThree("1"); } else { accentsAboveMean.setOneThree("0"); } if (Integer.parseInt(rhythmicAccents.getOneFour()) > mean) { accentsAboveMean.setOneFour("1"); } else { accentsAboveMean.setOneFour("0"); } if (Integer.parseInt(rhythmicAccents.getTwoOne()) > mean) { accentsAboveMean.setTwoOne("1"); } else { accentsAboveMean.setTwoOne("0"); } if (Integer.parseInt(rhythmicAccents.getTwoTwo()) > mean) { accentsAboveMean.setTwoTwo("1"); } else { accentsAboveMean.setTwoTwo("0"); } if (Integer.parseInt(rhythmicAccents.getTwoThree()) > mean) { accentsAboveMean.setTwoThree("1"); } else { accentsAboveMean.setTwoThree("0"); } if (Integer.parseInt(rhythmicAccents.getTwoFour()) > mean) { accentsAboveMean.setTwoFour("1"); } else { accentsAboveMean.setTwoFour("0"); } if (Integer.parseInt(rhythmicAccents.getThreeOne()) > mean) { accentsAboveMean.setThreeOne("1"); } else { accentsAboveMean.setThreeOne("0"); } if (Integer.parseInt(rhythmicAccents.getThreeTwo()) > mean) { accentsAboveMean.setThreeTwo("1"); } else { accentsAboveMean.setThreeTwo("0"); } if (Integer.parseInt(rhythmicAccents.getThreeThree()) > mean) { accentsAboveMean.setThreeThree("1"); } else { accentsAboveMean.setThreeThree("0"); } if (Integer.parseInt(rhythmicAccents.getThreeFour()) > mean) { accentsAboveMean.setThreeFour("1"); } else { accentsAboveMean.setThreeFour("0"); } if (Integer.parseInt(rhythmicAccents.getFourOne()) > mean) { accentsAboveMean.setFourOne("1"); } else { accentsAboveMean.setFourOne("0"); } if (Integer.parseInt(rhythmicAccents.getFourTwo()) > mean) { accentsAboveMean.setFourTwo("1"); } else { accentsAboveMean.setFourTwo("0"); } if (Integer.parseInt(rhythmicAccents.getFourThree()) > mean) { accentsAboveMean.setFourThree("1"); } else { accentsAboveMean.setFourThree("0"); } if (Integer.parseInt(rhythmicAccents.getFourFour()) > mean) { accentsAboveMean.setFourFour("1"); } else { accentsAboveMean.setFourFour("0"); } return accentsAboveMean; }  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 setAccentsAboveMean(RhythmicAccents rhythmicAccents, int mean) { RhythmicAccents accentsAboveMean = new RhythmicAccents(); if (Integer.parseInt(rhythmicAccents.getOneOne()) > mean) { accentsAboveMean.setOneOne("1"); } else { accentsAboveMean.setOneOne("0"); } if (Integer.parseInt(rhythmicAccents.getOneTwo()) > mean) { accentsAboveMean.setOneTwo("1"); } else { accentsAboveMean.setOneTwo("0"); } if (Integer.parseInt(rhythmicAccents.getOneThree()) > mean) { accentsAboveMean.setOneThree("1"); } else { accentsAboveMean.setOneThree("0"); } if (Integer.parseInt(rhythmicAccents.getOneFour()) > mean) { accentsAboveMean.setOneFour("1"); } else { accentsAboveMean.setOneFour("0"); } if (Integer.parseInt(rhythmicAccents.getTwoOne()) > mean) { accentsAboveMean.setTwoOne("1"); } else { accentsAboveMean.setTwoOne("0"); } if (Integer.parseInt(rhythmicAccents.getTwoTwo()) > mean) { accentsAboveMean.setTwoTwo("1"); } else { accentsAboveMean.setTwoTwo("0"); } if (Integer.parseInt(rhythmicAccents.getTwoThree()) > mean) { accentsAboveMean.setTwoThree("1"); } else { accentsAboveMean.setTwoThree("0"); } if (Integer.parseInt(rhythmicAccents.getTwoFour()) > mean) { accentsAboveMean.setTwoFour("1"); } else { accentsAboveMean.setTwoFour("0"); } if (Integer.parseInt(rhythmicAccents.getThreeOne()) > mean) { accentsAboveMean.setThreeOne("1"); } else { accentsAboveMean.setThreeOne("0"); } if (Integer.parseInt(rhythmicAccents.getThreeTwo()) > mean) { accentsAboveMean.setThreeTwo("1"); } else { accentsAboveMean.setThreeTwo("0"); } if (Integer.parseInt(rhythmicAccents.getThreeThree()) > mean) { accentsAboveMean.setThreeThree("1"); } else { accentsAboveMean.setThreeThree("0"); } if (Integer.parseInt(rhythmicAccents.getThreeFour()) > mean) { accentsAboveMean.setThreeFour("1"); } else { accentsAboveMean.setThreeFour("0"); } if (Integer.parseInt(rhythmicAccents.getFourOne()) > mean) { accentsAboveMean.setFourOne("1"); } else { accentsAboveMean.setFourOne("0"); } if (Integer.parseInt(rhythmicAccents.getFourTwo()) > mean) { accentsAboveMean.setFourTwo("1"); } else { accentsAboveMean.setFourTwo("0"); } if (Integer.parseInt(rhythmicAccents.getFourThree()) > mean) { accentsAboveMean.setFourThree("1"); } else { accentsAboveMean.setFourThree("0"); } if (Integer.parseInt(rhythmicAccents.getFourFour()) > mean) { accentsAboveMean.setFourFour("1"); } else { accentsAboveMean.setFourFour("0"); } return accentsAboveMean; }  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);  }