From 186c6f4e1b0cf9638d7e01ac788fd73cdde1aa43 Mon Sep 17 00:00:00 2001 From: probonopd Date: Thu, 17 Mar 2022 18:46:45 +0100 Subject: [PATCH] Fix Pitch Bend and Modulation https://github.com/probonopd/MiniDexed/issues/9#issuecomment-1069626653 Thanks @rsta2 --- src/dexedadapter.h | 7 +++++++ src/mididevice.cpp | 1 + src/minidexed.cpp | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/dexedadapter.h b/src/dexedadapter.h index 0322dd4..3e85c1b 100644 --- a/src/dexedadapter.h +++ b/src/dexedadapter.h @@ -63,6 +63,13 @@ public: m_SpinLock.Release (); } + void ControllersRefresh (void) + { + m_SpinLock.Acquire (); + Dexed::ControllersRefresh (); + m_SpinLock.Release (); + } + private: CSpinLock m_SpinLock; }; diff --git a/src/mididevice.cpp b/src/mididevice.cpp index 4bb052b..16164cb 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -134,6 +134,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign { case MIDI_CC_MODULATION: m_pSynthesizer->setModWheel (pMessage[2]); + m_pSynthesizer->ControllersRefresh (); break; case MIDI_CC_VOLUME: diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 4217c35..4e4d8cf 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -102,6 +102,9 @@ bool CMiniDexed::Initialize (void) ProgramChange (0); setTranspose (24); + setPBController (12, 1); + setMWController (99, 7, 0); + // setup and start the sound device if (!m_pSoundDevice->AllocateQueueFrames (m_pConfig->GetChunkSize ())) {