commit c80ad043dcdfba55ca29a4b494ce5d76432c211a
parent 95b665b0ff79a635a68a156f6fddbe470e54985e
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Wed, 6 Nov 2024 18:30:52 +0100
fix UI not reacting to program change messages
Diffstat:
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/source/jucePluginLib/processor.cpp b/source/jucePluginLib/processor.cpp
@@ -543,7 +543,7 @@ namespace pluginLib
const auto status = ev.a & 0xf0;
- if(status == synthLib::M_CONTROLCHANGE || status == synthLib::M_POLYPRESSURE)
+ if(status == synthLib::M_CONTROLCHANGE || status == synthLib::M_POLYPRESSURE || status == synthLib::M_PROGRAMCHANGE)
{
// forward to UI to react to control input changes that should move knobs
getController().enqueueMidiMessages({ev});
diff --git a/source/virusJucePlugin/VirusController.cpp b/source/virusJucePlugin/VirusController.cpp
@@ -528,7 +528,9 @@ namespace virus
uint8_t page;
if (status == synthLib::M_CONTROLCHANGE)
+ {
page = virusLib::PAGE_A;
+ }
else if (status == synthLib::M_POLYPRESSURE)
{
// device decides if PP is enabled and will echo any parameter change to us. Reject any other source
@@ -536,8 +538,31 @@ namespace virus
return false;
page = virusLib::PAGE_B;
}
+ else if(status == synthLib::M_PROGRAMCHANGE)
+ {
+ if(isMultiMode())
+ {
+ for(uint8_t p=0; p<getPartCount(); ++p)
+ {
+ const auto idx = getParameterIndexByName("Part Midi Channel");
+ if(idx == pluginLib::Controller::InvalidParameterIndex)
+ continue;
+
+ const auto v = getParameter(idx, p);
+ if(v->getUnnormalizedValue() == part)
+ requestSingle(toMidiByte(virusLib::BankNumber::EditBuffer), p);
+ }
+ }
+ else
+ {
+ requestSingle(toMidiByte(virusLib::BankNumber::EditBuffer), virusLib::SINGLE);
+ }
+ return true;
+ }
else
+ {
return false;
+ }
const auto& params = findSynthParam(part, page, m.b);
for (const auto & p : params)