sfizz
sfizz copied to clipboard
Crash fix: if `Voice::startVoice()` fails, clean up immediately
If a Voice fails to start, it's left as State::cleanMeUp. However, the main render loop assumes voices are either State::idle or State::playing, and only checks voice.toBeCleanedUp() at the end.
There are various ways to fix it (e.g. checking at the top of the main render loop!) but resetting Voices immediately after a failed start also makes them available again to respond to the next incoming trigger.