Added reset for EXT-24 between longer pauses
This commit is contained in:
@ -189,20 +189,26 @@ void externalClock() {
|
|||||||
pulseCount = 0;
|
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() {
|
void sendTriggers() {
|
||||||
|
|
||||||
calculateCycles();
|
calculateCycles();
|
||||||
|
|
||||||
//switching modes on the beat and resetting channel clock
|
//switching modes on the beat and resetting channel clock
|
||||||
if (pulseCount == 0) {
|
if (pulseCount == 0) {
|
||||||
for (int i = 0; i<6; i++) {
|
for (int i = 0; i<6; i++) {
|
||||||
if (playingModes[i] != clockModes[channels[i].mode]) {
|
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;
|
channelPulseCount[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// calculateCycles();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//multiplier
|
//multiplier
|
||||||
@ -221,20 +227,6 @@ void sendTriggers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void calculateCycles() {
|
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++) {
|
for (int i = 0; i<6; i++) {
|
||||||
if (channels[i].modulationRange == 0) {
|
if (channels[i].modulationRange == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user