Skip to content

Commit

Permalink
Fix mono not retrigger
Browse files Browse the repository at this point in the history
  • Loading branch information
FigBug committed Feb 15, 2024
1 parent 23cb8ef commit 1fcd794
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions modules/gin_dsp/dsp/gin_synthesiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ class Synthesiser : public juce::MPESynthesiser
bool currentNote = noteIdx == noteStack.size() - 1;
noteStack.remove (noteIdx);

auto sv = dynamic_cast<SynthesiserVoice*> (voices[0]);
if (sv == nullptr) return;

if (noteStack.isEmpty())
{
for (auto voice : voices)
Expand All @@ -197,16 +200,13 @@ class Synthesiser : public juce::MPESynthesiser

return;
}

if (currentNote)
for (auto voice : voices)
if (voice->isActive())
if (finishedNote == voice->getCurrentlyPlayingNote())
stopVoiceFastKill (voice, finishedNote, true);

if (noteStack.size() > 0)
if (auto voice = findFreeVoice (noteStack.getLast(), false))
startVoice (voice, noteStack.getLast());
else if (currentNote)
{
if (sv->isActive())
retriggerVoice (sv, noteStack.getLast());
else
startVoice (sv, noteStack.getLast());
}
}

bool isNotePlaying (juce::MPENote& n)
Expand Down

0 comments on commit 1fcd794

Please sign in to comment.