@Test public void shouldFindThreeMatchingKeys() { List<HiveChord> hiveChords = new ArrayList<>(); hiveChords.add(new HiveChord("dmaj")); List<String> compatibleKeys = HarmonicKeyUtils.findCompatibleKeys(hiveChords); assertThat(compatibleKeys).hasSize(3); assertThat(compatibleKeys).contains(KeyNames.G_MAJOR, KeyNames.D_MAJOR, KeyNames.A_MAJOR); }
public static List<String> findCompatibleKeys(List<HiveChord> hiveChords) { List<String> compatibleKeys = new ArrayList<>(); for (Map.Entry<String, List<HiveChord>> chordList : KEYS.entrySet()) { boolean allMatch = true; for (HiveChord chordInList : hiveChords) { if (!isChordInKey(chordInList, chordList.getValue())) { allMatch = false; } } if (allMatch) { compatibleKeys.add(chordList.getKey()); } } return compatibleKeys; }
HarmonicKeyUtils { public static List<String> findCompatibleKeys(List<HiveChord> hiveChords) { List<String> compatibleKeys = new ArrayList<>(); for (Map.Entry<String, List<HiveChord>> chordList : KEYS.entrySet()) { boolean allMatch = true; for (HiveChord chordInList : hiveChords) { if (!isChordInKey(chordInList, chordList.getValue())) { allMatch = false; } } if (allMatch) { compatibleKeys.add(chordList.getKey()); } } return compatibleKeys; } }
HarmonicKeyUtils { public static List<String> findCompatibleKeys(List<HiveChord> hiveChords) { List<String> compatibleKeys = new ArrayList<>(); for (Map.Entry<String, List<HiveChord>> chordList : KEYS.entrySet()) { boolean allMatch = true; for (HiveChord chordInList : hiveChords) { if (!isChordInKey(chordInList, chordList.getValue())) { allMatch = false; } } if (allMatch) { compatibleKeys.add(chordList.getKey()); } } return compatibleKeys; }  }
HarmonicKeyUtils { public static List<String> findCompatibleKeys(List<HiveChord> hiveChords) { List<String> compatibleKeys = new ArrayList<>(); for (Map.Entry<String, List<HiveChord>> chordList : KEYS.entrySet()) { boolean allMatch = true; for (HiveChord chordInList : hiveChords) { if (!isChordInKey(chordInList, chordList.getValue())) { allMatch = false; } } if (allMatch) { compatibleKeys.add(chordList.getKey()); } } return compatibleKeys; }  static List<String> findCompatibleKeys(List<HiveChord> hiveChords); static Map<ProgressionUnit.ProgressionType, List<String>> convertProgressionsToChordLists(List<ProgressionUnit> progressionUnits); }
HarmonicKeyUtils { public static List<String> findCompatibleKeys(List<HiveChord> hiveChords) { List<String> compatibleKeys = new ArrayList<>(); for (Map.Entry<String, List<HiveChord>> chordList : KEYS.entrySet()) { boolean allMatch = true; for (HiveChord chordInList : hiveChords) { if (!isChordInKey(chordInList, chordList.getValue())) { allMatch = false; } } if (allMatch) { compatibleKeys.add(chordList.getKey()); } } return compatibleKeys; }  static List<String> findCompatibleKeys(List<HiveChord> hiveChords); static Map<ProgressionUnit.ProgressionType, List<String>> convertProgressionsToChordLists(List<ProgressionUnit> progressionUnits); static HashMap<String, List<HiveChord>> KEYS; }