| 125 | } |
| 126 | |
| 127 | void SynthController::_sanitizeVoices() |
| 128 | { |
| 129 | // Insert note off event to avoid hanging notes |
| 130 | for (int i = 0; i < mSynth->getNumVoices(); i++) { |
| 131 | auto* voice = dynamic_cast<SynthVoice*>(mSynth->getVoice(i)); |
| 132 | if (voice->isActive()) { |
| 133 | auto midi_note = voice->getCurrentMidiNote(); |
| 134 | |
| 135 | if (!_isNextOnOffEventNoteOff(midi_note)) { |
| 136 | voice->noteStopped(true); |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | void SynthController::_updateCurrentEventIndex() |
| 143 | { |
nothing calls this directly
no test coverage detected