@Test public void ShouldSetFirstChordInChangePair() { List<ProgressionUnit> progressionUnits = new ArrayList<>(); ProgressionUnit verse = new ProgressionUnit(); verse.initBars(FOUR.getValue()); verse.setType(ProgressionUnit.ProgressionType.VERSE); ProgressionUnit bridge = new ProgressionUnit(); bridge.initBars(FOUR.getValue()); bridge.setType(ProgressionUnit.ProgressionType.BRIDGE); ProgressionUnit chorus = new ProgressionUnit(); chorus.initBars(FOUR.getValue()); chorus.setType(ProgressionUnit.ProgressionType.CHORUS); progressionUnits.add(verse); progressionUnits.add(chorus); progressionUnits.add(verse); progressionUnits.add(bridge); HashMap<ProgressionUnit.ProgressionType, HiveChord> typeAndFirstChord = new HashMap<ProgressionUnit.ProgressionType, HiveChord>(); typeAndFirstChord.put(ProgressionUnit.ProgressionType.BRIDGE, new HiveChord("c#_dom7")); typeAndFirstChord.put(ProgressionUnit.ProgressionType.VERSE, new HiveChord("a#_dom7")); typeAndFirstChord.put(ProgressionUnit.ProgressionType.CHORUS, new HiveChord("f#_maj7")); chordStructureGenerator.setFirstChordInProgressions(progressionUnits, typeAndFirstChord); assertTrue(progressionUnits.get(0).getProgressionUnitBars().get(0).getChord().isEqual("a#_dom7")); assertTrue(progressionUnits.get(1).getProgressionUnitBars().get(0).getChord().isEqual("f#_maj7")); assertTrue(progressionUnits.get(2).getProgressionUnitBars().get(0).getChord().isEqual("a#_dom7")); assertTrue(progressionUnits.get(3).getProgressionUnitBars().get(0).getChord().isEqual("c#_dom7")); }
public boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord) { String attemptString = ""; for (ProgressionUnit progression : progressionUnits) { HiveChord chord = typeAndFirstChord.get(progression.getType()); if(chord == null){ return false; } progression.getProgressionUnitBars().get(ChordPositions.CHORD_ONE).setChord(chord); attemptString += chord.getChordName(); } Application.logger.debug("LOG: attemptString :" + attemptString); return true; }
ChordStructureGenerator implements IChordStructureGenerator { public boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord) { String attemptString = ""; for (ProgressionUnit progression : progressionUnits) { HiveChord chord = typeAndFirstChord.get(progression.getType()); if(chord == null){ return false; } progression.getProgressionUnitBars().get(ChordPositions.CHORD_ONE).setChord(chord); attemptString += chord.getChordName(); } Application.logger.debug("LOG: attemptString :" + attemptString); return true; } }
ChordStructureGenerator implements IChordStructureGenerator { public boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord) { String attemptString = ""; for (ProgressionUnit progression : progressionUnits) { HiveChord chord = typeAndFirstChord.get(progression.getType()); if(chord == null){ return false; } progression.getProgressionUnitBars().get(ChordPositions.CHORD_ONE).setChord(chord); attemptString += chord.getChordName(); } Application.logger.debug("LOG: attemptString :" + attemptString); return true; }  }
ChordStructureGenerator implements IChordStructureGenerator { public boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord) { String attemptString = ""; for (ProgressionUnit progression : progressionUnits) { HiveChord chord = typeAndFirstChord.get(progression.getType()); if(chord == null){ return false; } progression.getProgressionUnitBars().get(ChordPositions.CHORD_ONE).setChord(chord); attemptString += chord.getChordName(); } Application.logger.debug("LOG: attemptString :" + attemptString); return true; }  List<ProgressionType> getProgressionTypes(QueueItem queueItem); QueueState set(QueueState queueState); boolean setChordThree(List<ProgressionUnit> progressionUnits, List<HiveChord> hiveChordInDatabase); boolean setChordTwo(List<HiveChord> hiveChordInDatabase, List<ProgressionUnit> progressionUnits); boolean setChordFour(List<HiveChord> hiveChordInDatabase, List<ProgressionUnit> progressionUnits); boolean set2nd3rd4thChordsFor4BarLoops(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, List<HiveChord>> progressionTypeListHashMap); boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord); }
ChordStructureGenerator implements IChordStructureGenerator { public boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord) { String attemptString = ""; for (ProgressionUnit progression : progressionUnits) { HiveChord chord = typeAndFirstChord.get(progression.getType()); if(chord == null){ return false; } progression.getProgressionUnitBars().get(ChordPositions.CHORD_ONE).setChord(chord); attemptString += chord.getChordName(); } Application.logger.debug("LOG: attemptString :" + attemptString); return true; }  List<ProgressionType> getProgressionTypes(QueueItem queueItem); QueueState set(QueueState queueState); boolean setChordThree(List<ProgressionUnit> progressionUnits, List<HiveChord> hiveChordInDatabase); boolean setChordTwo(List<HiveChord> hiveChordInDatabase, List<ProgressionUnit> progressionUnits); boolean setChordFour(List<HiveChord> hiveChordInDatabase, List<ProgressionUnit> progressionUnits); boolean set2nd3rd4thChordsFor4BarLoops(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, List<HiveChord>> progressionTypeListHashMap); boolean setFirstChordInProgressions(List<ProgressionUnit> progressionUnits, HashMap<ProgressionType, HiveChord> typeAndFirstChord);  }