Added quantization

This commit is contained in:
2023-08-03 00:53:15 +03:00
parent a40f7ec67d
commit 392f536203
3 changed files with 11 additions and 2 deletions

View File

@ -82,6 +82,7 @@ int playingModes[6]; //actual channel modes array updated from channels object
unsigned int pulsePeriod;
bool isPlaying = false;
bool isRecording = false;
bool recordToNextStep = false;
unsigned int tickCount = 0;
unsigned int pulseCount = 0;
@ -318,6 +319,9 @@ void sendTriggers() {
}
if (sixteenthPulseCount < (PPQN / 4) - 1) {
sixteenthPulseCount++;
if (sixteenthPulseCount > 3) { //quantization. might need fine-tuning
recordToNextStep = true;
}
} else {
sixteenthPulseCount = 0;
if (currentStep < 15) {
@ -325,6 +329,7 @@ void sendTriggers() {
} else {
currentStep = 0;
}
recordToNextStep = false;
}
//switching modes on the beat and resetting channel clock