bpm can't be modulated higher than maxbpm. fixed the offset bug in menu
This commit is contained in:
@ -524,7 +524,9 @@ void calculateBPMTiming() {
|
|||||||
} else if (bpmModulationRange != 0 && bpmModulationChannel == 1) {
|
} else if (bpmModulationRange != 0 && bpmModulationChannel == 1) {
|
||||||
mod = map(CV2Input, 0, 1023, bpmModulationRange * -10, bpmModulationRange * 10);
|
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)
|
} else if (masterClockMode == 1 && extClockPPQN == 1) { //for ext 1/16 clock (hardcoded)
|
||||||
pulsePeriod = (newExtPulseTime - lastExtPulseTime) / 6;
|
pulsePeriod = (newExtPulseTime - lastExtPulseTime) / 6;
|
||||||
|
|||||||
@ -255,7 +255,7 @@ void checkInputs() {
|
|||||||
&& displayTab != 0 && menuItem == 2
|
&& displayTab != 0 && menuItem == 2
|
||||||
&& channels[displayTab - 1].mode == 0) { //Offset
|
&& channels[displayTab - 1].mode == 0) { //Offset
|
||||||
channels[displayTab - 1].offset = channels[displayTab - 1].offset + change;
|
channels[displayTab - 1].offset = channels[displayTab - 1].offset + change;
|
||||||
if (channels[displayTab - 1].offset > 1000) {
|
if (channels[displayTab - 1].offset == 255) { // 0 - 1 for uint8 is 255
|
||||||
channels[displayTab - 1].offset = 0;
|
channels[displayTab - 1].offset = 0;
|
||||||
} else if (channels[displayTab - 1].offset > channelPulsesPerCycle[displayTab-1]) {
|
} else if (channels[displayTab - 1].offset > channelPulsesPerCycle[displayTab-1]) {
|
||||||
channels[displayTab - 1].offset = channelPulsesPerCycle[displayTab-1];
|
channels[displayTab - 1].offset = channelPulsesPerCycle[displayTab-1];
|
||||||
|
|||||||
Reference in New Issue
Block a user