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 b195f0441cbfc7006db1d0855297828813115f2d
parent 5df8f9bc2b5fe66d76be94abeb4405a496cf6841
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun,  4 Aug 2024 19:45:13 +0200

Merge branch 'oss/main' into priv/n2x

Diffstat:
Msource/jucePluginLib/CMakeLists.txt | 5+++++
Msource/jucePluginLib/parameter.cpp | 6------
Msource/xtLib/xtState.cpp | 25++++++++++++++++++-------
Msource/xtLib/xtState.h | 2++
4 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/source/jucePluginLib/CMakeLists.txt b/source/jucePluginLib/CMakeLists.txt @@ -3,6 +3,9 @@ project(jucePluginLib VERSION ${CMAKE_PROJECT_VERSION}) configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in ${CMAKE_CURRENT_LIST_DIR}/version.h) +file(TOUCH_NOCREATE ${CMAKE_CURRENT_LIST_DIR}/version.h.in) +file(TOUCH_NOCREATE ${CMAKE_CURRENT_LIST_DIR}/versionDateTime.h.in) + set(SOURCES createVersionDateTime.cmake clipboard.cpp clipboard.h @@ -54,8 +57,10 @@ target_compile_definitions(jucePluginLib PRIVATE JUCE_GLOBAL_MODULE_SETTINGS_INC set_property(TARGET jucePluginLib PROPERTY FOLDER "Gearmulator") add_custom_command( + PRE_BUILD OUTPUT ${CMAKE_CURRENT_LIST_DIR}/_doesnotexist_versionDateTime.h # fake, causes regeneration for every build, exactly what we want OUTPUT ${CMAKE_CURRENT_LIST_DIR}/versionDateTime.h # valid + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/versionDateTime.h.in COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_LIST_DIR}/createVersionDateTime.cmake" ) diff --git a/source/jucePluginLib/parameter.cpp b/source/jucePluginLib/parameter.cpp @@ -175,13 +175,7 @@ namespace pluginLib m_value.setValue(clampValue(_newValue)); if(_origin != Origin::Derived) - { sendToSynth(); - } - else - { - m_value.setValue(_newValue); - } forwardToDerived(_newValue); } diff --git a/source/xtLib/xtState.cpp b/source/xtLib/xtState.cpp @@ -203,14 +203,13 @@ namespace xt auto setParam = [&](const GlobalParameter _param, const uint8_t _value) { - setGlobalParameter(_param, _value); + sendGlobalParameter(_param, _value); }; setParam(GlobalParameter::StartupSoundbank, 0); // First bank setParam(GlobalParameter::StartupSoundNum, 0); // First sound setParam(GlobalParameter::StartupMultiNumber, 0); // First Multi - setParam(GlobalParameter::MidiChannel, 0); // omni setParam(GlobalParameter::ProgramChangeMode, 0); // single setParam(GlobalParameter::MasterTune, 64); // 440 Hz setParam(GlobalParameter::Transpose, 64); // +/- 0 @@ -218,7 +217,7 @@ namespace xt setParam(GlobalParameter::ParameterReceive, 1); // on setParam(GlobalParameter::ArpNoteOutChannel, 0); // off setParam(GlobalParameter::MidiClockOutput, 0); // off - setParam(GlobalParameter::MidiChannel, 0); // omni + setParam(GlobalParameter::MidiChannel, 1); // omni setParam(GlobalParameter::DeviceId, 0); // 0 setParam(GlobalParameter::InputGain, 3); // 4 @@ -272,7 +271,10 @@ namespace xt bool State::parseModeDump(const SysEx& _data) { - return convertTo(m_mode, _data); + if(!convertTo(m_mode, _data)) + return false; + onPlayModeChanged(); + return true; } bool State::modifySingle(const SysEx& _data) @@ -316,9 +318,7 @@ namespace xt *p = _data[IdxModeParamValue]; - // if the play mode is changed, request the edit buffer for the first single again, because on the xt, that edit buffer is shared between multi & single - - requestSingle(isMultiMode() ? LocationH::SingleEditBufferMultiMode : LocationH::SingleEditBufferSingleMode, 0); + onPlayModeChanged(); return true; } @@ -690,4 +690,15 @@ namespace xt } */ } + + void State::onPlayModeChanged() + { + // if the play mode is changed, force a re-request of the edit buffer for the first single again, because on the device, that edit buffer is shared between multi & single + m_currentMultiSingles[0][0] = 0; + m_currentInstrumentSingles[0][0] = 0; + + // also, as the multi is not valid if the machine is not in multi mode, invalidate the existing data to force a re-request from the device + if(isMultiMode()) + m_currentMulti[0] = 0; + } } diff --git a/source/xtLib/xtState.h b/source/xtLib/xtState.h @@ -176,6 +176,8 @@ namespace xt void sendSysex(const std::initializer_list<uint8_t>& _data) const; void sendSysex(const SysEx& _data) const; + void onPlayModeChanged(); + Xt& m_xt; // ROM