bpm can't be modulated higher than maxbpm. fixed the offset bug in menu

This commit is contained in:
Oleksiy
2024-09-08 21:44:19 +03:00
parent 70ebaba270
commit cb88ec0e30
2 changed files with 4 additions and 2 deletions

View File

@ -524,7 +524,9 @@ void calculateBPMTiming() {
} else if (bpmModulationRange != 0 && bpmModulationChannel == 1) {
mod = map(CV2Input, 0, 1023, bpmModulationRange * -10, bpmModulationRange * 10);
}
pulsePeriod = 600000 / ((bpm + mod) * PPQN);
byte calcbpm = bpm + mod;
if (calcbpm > MAXBPM) { calcbpm = MAXBPM; };
pulsePeriod = 600000 / (calcbpm * PPQN);
} else if (masterClockMode == 1 && extClockPPQN == 1) { //for ext 1/16 clock (hardcoded)
pulsePeriod = (newExtPulseTime - lastExtPulseTime) / 6;