Add failsafe when fetching new frame in loop

pull/170/head
James Ball 2023-08-28 22:09:34 +01:00
rodzic 13a6a6e2e3
commit 4667019163
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -15,8 +15,10 @@ void ShapeVoice::startNote(int midiNoteNumber, float velocity, juce::Synthesiser
if (shapeSound != nullptr) {
this->sound = shapeSound;
while (frame.empty()) {
int tries = 0;
while (frame.empty() && tries < 20) {
frameLength = shapeSound->updateFrame(frame);
tries++;
}
tailOff = 0.0;
frequency = juce::MidiMessage::getMidiNoteInHertz(midiNoteNumber);