示例#1
0
文件: BeatGroup.java 项目: patrom/cp
 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;
 }
示例#2
0
文件: BeatGroup.java 项目: patrom/cp
 public List<Note> getNotesRandom() {
   RhythmCombination rhythmCombination = RandomUtil.getRandomFromList(rhythmCombinations);
   return rhythmCombination.getNotes(getBeatLength());
 }