|
|
|
@ -600,10 +600,22 @@ void loop() |
|
|
|
|
eeprom_update(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// check for value changes and unused voices
|
|
|
|
|
// check for value changes, unused voices and CPU overload
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
{ |
|
|
|
|
active_voices[instance_id] = MicroDexed[instance_id]->getNumNotesPlaying(); |
|
|
|
|
#ifdef CPU_OVERLOAD_THROTTLE |
|
|
|
|
if (AudioProcessorUsageMax() > 99.9) |
|
|
|
|
{ |
|
|
|
|
AudioProcessorUsageMaxReset(); |
|
|
|
|
MicroDexed[instance_id]->keyup(-1); // kills the oldest note and decreases max_notes
|
|
|
|
|
Serial.print(F("!!!CPU overload!!! Automatic throttling max_notes to ")); |
|
|
|
|
Serial.print(MicroDexed[instance_id]->getMaxNotes(), DEC); |
|
|
|
|
Serial.print(F(" for instance ")); |
|
|
|
|
Serial.print(instance_id, DEC); |
|
|
|
|
Serial.println(F(".")); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|