Added reset for EXT-24 between longer pauses

This commit is contained in:
--global
2023-05-09 23:39:56 +03:00
parent 4425550f5b
commit ae994d81e6

View File

@ -189,20 +189,26 @@ void externalClock() {
pulseCount = 0;
}
}
//reset cycles if there was no pulses for a while
if ((newExtPulseTime - lastExtPulseTime) > 125) { //125ms is 20bpm
for (int i = 0; i<6; i++) {
channelPulseCount[i] = 0;
}
}
}
void sendTriggers() {
calculateCycles();
//switching modes on the beat and resetting channel clock
if (pulseCount == 0) {
for (int i = 0; i<6; i++) {
if (playingModes[i] != clockModes[channels[i].mode]) {
// calculateCycles(); this shouldn't be inside the loop. but it was here and it worked
channelPulseCount[i] = 0;
}
}
// calculateCycles();
}
//multiplier
@ -221,20 +227,6 @@ void sendTriggers() {
}
void calculateCycles() {
/*modulation
for (int i = 0; i<6; i++) {
if (channels[i].modulationRange != 0) {
int mod;
if (!channels[i].modulationChannel) {
mod = a1Input;
} else {
mod = a2Input;
}
mod = map (mod, 0, 1023, 0, channels[i].modulationRange);
playingModes[i] = clockModes[channels[i].mode - mod]; //subtracting because the innitiall array is backwards
}
}*/
for (int i = 0; i<6; i++) {
if (channels[i].modulationRange == 0) {