gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 30e7536bab38c6b60f1ad1cdeb2dd6ec9e34bf62
parent 8e921724a249f0c59b7aadd4e857b877e852ad22
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Thu,  1 Aug 2024 21:53:53 +0200

magic value / naming

Diffstat:
Msource/nord/n2x/n2xJucePlugin/n2xController.cpp | 10++++++----
Msource/nord/n2x/n2xJucePlugin/n2xController.h | 2+-
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/source/nord/n2x/n2xJucePlugin/n2xController.cpp b/source/nord/n2x/n2xJucePlugin/n2xController.cpp @@ -25,6 +25,8 @@ namespace { return g_midiPacketNames[static_cast<uint32_t>(_type)]; } + + constexpr uint32_t g_multiPage = 10; } namespace n2xJucePlugin @@ -172,9 +174,9 @@ namespace n2xJucePlugin void Controller::sendParameterChange(const pluginLib::Parameter& _parameter, uint8_t _value) { - if(_parameter.getDescription().page >= 10) + if(_parameter.getDescription().page >= g_multiPage) { - sendPerformanceParameter(_parameter, _value); + sendMultiParameter(_parameter, _value); return; } @@ -202,11 +204,11 @@ namespace n2xJucePlugin sendMidiEvent(synthLib::M_CONTROLCHANGE, cc, _value); } - void Controller::sendPerformanceParameter(const pluginLib::Parameter& _parameter, const uint8_t _value) + void Controller::sendMultiParameter(const pluginLib::Parameter& _parameter, const uint8_t _value) { const auto& desc = _parameter.getDescription(); - const auto mp = static_cast<n2x::MultiParam>(desc.index + (desc.page - 10) * 128); + const auto mp = static_cast<n2x::MultiParam>(desc.index + (desc.page - g_multiPage) * 128); if(!m_state.changeMultiParameter(mp, _value)) return; diff --git a/source/nord/n2x/n2xJucePlugin/n2xController.h b/source/nord/n2x/n2xJucePlugin/n2xController.h @@ -39,7 +39,7 @@ namespace n2xJucePlugin bool parseControllerMessage(const synthLib::SMidiEvent&) override; void sendParameterChange(const pluginLib::Parameter& _parameter, uint8_t _value) override; - void sendPerformanceParameter(const pluginLib::Parameter& _parameter, uint8_t _value); + void sendMultiParameter(const pluginLib::Parameter& _parameter, uint8_t _value); bool sendSysEx(MidiPacketType _packet, const std::map<pluginLib::MidiDataType, uint8_t>& _params) const; void requestDump(uint8_t _bank, uint8_t _patch) const;