Chance setting

This commit is contained in:
Dejvino
2026-03-07 21:31:17 +01:00
parent 99add4e2ac
commit f34f960358
7 changed files with 70 additions and 2 deletions
+4 -1
View File
@@ -133,7 +133,10 @@ static void handlePlayback() {
// If tied to the SAME note, do not retrigger (sustain)
bool isContinuing = wasTied && (prevNote == currentNote) && !justPanicked;
if (!trackMute[t] && currentNote != -1 && !isContinuing) {
// Check chance
bool shouldPlay = (random(100) < trackChance[t]);
if (!trackMute[t] && currentNote != -1 && !isContinuing && shouldPlay) {
uint8_t velocity = local_sequence[t][current_step].accent ? 127 : 100;
midi.sendNoteOn(currentNote, velocity, trackChannel);
}