Skip to content

Commit

Permalink
Fix stuck notes on switch mono on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
FigBug committed Sep 28, 2023
1 parent 73ca1e6 commit 3de6fc1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix crash initializing plugin on Linux
- Fix channel config on Linux
- Renamed Legato rate to Legato Time
- Fix stuck notes on switch mono on/off

1.0.2:

Expand Down
8 changes: 6 additions & 2 deletions plugin/Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ WavetableAudioProcessor::WavetableAudioProcessor()

setupModMatrix();
init();

lastMono = globalParams.mono->isOn();
}

WavetableAudioProcessor::~WavetableAudioProcessor()
Expand Down Expand Up @@ -619,6 +621,7 @@ void WavetableAudioProcessor::stateUpdated()

reloadWavetables();
presetLoaded = true;
lastMono = globalParams.mono->isOn();
}

void WavetableAudioProcessor::updateState()
Expand Down Expand Up @@ -732,9 +735,10 @@ void WavetableAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju
return;
}

if (blockMissed || presetLoaded)
if (blockMissed || presetLoaded || lastMono != globalParams.mono->isOn())
{
blockMissed = presetLoaded = false;
lastMono = ! lastMono;
turnOffAllVoices (false);
}

Expand All @@ -748,7 +752,7 @@ void WavetableAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju

buffer.clear();

setMono (globalParams.mono->isOn());
setMono (lastMono);
setLegato (globalParams.legato->isOn());
setGlissando (globalParams.glideMode->getProcValue() == 1.0f);
setPortamento (globalParams.glideMode->getProcValue() == 2.0f);
Expand Down
1 change: 1 addition & 0 deletions plugin/Source/PluginProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class WavetableAudioProcessor : public gin::Processor,
juce::AudioPlayHead* playhead = nullptr;
bool blockMissed = false;
bool presetLoaded = false;
bool lastMono = false;

struct CurTable
{
Expand Down

0 comments on commit 3de6fc1

Please sign in to comment.