percussions = getRandomPercussionPattern();
}
// don't use the drums in some measures
if (Chance.test(6)) {
Phrase phr = new Phrase(0.0);
phr.addRest(new Rest(ctx.getNormalizedMeasureSize()));
fullKit.add(phr);
continue;
}
for (int j = 0; j < percussions.length; j++) {
Phrase phr = new Phrase(0.0);
for (short k = 0; k < 16; k++) {
int[] chances = PRIMARY_DRUM_PERCENTAGES;
if (j % 2 == 1 || percussions[j] == 46) {
chances = SECONDARY_DRUM_PERCENTAGES;
}
if ((useMiddleBeats && k % 2 == 1 && Chance.test(6)) || Chance.test(chances[k / 2])) {
Note note = NoteFactory.createNote(percussions[j], beatNoteLength);
if (k % 2 == 1) {
note.setDynamic(35 + random.nextInt(8));
} else {
note.setDynamic(45 + random.nextInt(10));
}
phr.addNote(note);
} else {
phr.addRest(new Rest(beatNoteLength));
}
}
fullKit.add(phr);
}