Beispiel #1
0
 public List<Note> getNotes() {
   int size = rhythmCombinations.size();
   int beatLength = getBeatLength() / size;
   RhythmCombination rhythmCombination = rhythmCombinations.get(0);
   List<Note> notes = rhythmCombination.getNotes(beatLength);
   List<Note> melodyNotes = new ArrayList<>(notes);
   for (int i = 1; i < size; i++) {
     rhythmCombination = rhythmCombinations.get(i);
     int beatPosition = i * beatLength;
     notes = rhythmCombination.getNotes(beatLength);
     notes.forEach(
         n -> {
           n.setPosition(n.getPosition() + beatPosition);
         });
     melodyNotes.addAll(notes);
   }
   return melodyNotes;
 }
Beispiel #2
0
 public List<Note> getNotesRandom() {
   RhythmCombination rhythmCombination = RandomUtil.getRandomFromList(rhythmCombinations);
   return rhythmCombination.getNotes(getBeatLength());
 }