class SetMelodicSynthEvent implements IEventChain {

    public Map<ProgressionType, List<String>> createTypeToChordSequenceMap(Map<ProgressionType, int[]> typeToMatchLengthAndOffset, List<BachChorale> chorales) {

        Map<ProgressionType, List<String>> typeToChordSequence = new HashMap<>();

        for (Map.Entry<ProgressionType, int[]> map : typeToMatchLengthAndOffset.entrySet()) {

            int startIndex = map.getValue()[1];
            int endIndex = map.getValue()[1] + map.getValue()[0];
            List<String> chordSequence = chorales.subList(startIndex, endIndex).stream().map(c -> c.getChord()).collect(Collectors.toList());
            typeToChordSequence.put(map.getKey(), chordSequence);
        }

        return typeToChordSequence;
    }

    @Autowired public  SetMelodicSynthEvent(MelodyGenerator melodydGenerator, MelodicExtractor melodicExtractor, IBachChoraleDal bachChoraleDal);

}