From 29bd890aaeb75bca17b749895f3d393c155beb58 Mon Sep 17 00:00:00 2001 From: Javier Nonis Date: Wed, 12 Feb 2025 00:21:29 -0300 Subject: [PATCH] Fix for disable FX feature --- src/minidexed.cpp | 19 +++++++++++++++---- src/minidexed.ini | 2 ++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 2e66a81..ea7d75e 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -496,7 +496,14 @@ void CMiniDexed::Run (unsigned nCore) m_pTG[nTG]->getSamples (m_OutputLevel[nTG][0],m_nFramesToProcess); m_InsertFXSpinLock[nTG]->Acquire(); - m_InsertFX[nTG]->process(m_OutputLevel[nTG][0], m_OutputLevel[nTG][0], m_OutputLevel[nTG][0], m_OutputLevel[nTG][1], m_nFramesToProcess); + if (!m_bQuadDAC8Chan && m_pConfig->GetFXEnabled()) + { + m_InsertFX[nTG]->process(m_OutputLevel[nTG][0], m_OutputLevel[nTG][0], m_OutputLevel[nTG][0], m_OutputLevel[nTG][1], m_nFramesToProcess); + } + else + { + memcpy(m_OutputLevel[nTG][1], m_OutputLevel[nTG][0], m_nFramesToProcess * sizeof(float32_t)); + } m_InsertFXSpinLock[nTG]->Release(); } } @@ -1572,7 +1579,7 @@ void CMiniDexed::ProcessSound (void) } else { - memcpy(SampleBuffer[indexR], SampleBuffer[indexR], nFrames * sizeof(float32_t)); + memcpy(SampleBuffer[indexR], SampleBuffer[indexL], nFrames * sizeof(float32_t)); } // swap stereo channels if needed prior to writing back out @@ -1640,12 +1647,16 @@ void CMiniDexed::ProcessSound (void) m_pTG[i]->getSamples (m_OutputLevel[i][0], nFrames); + m_InsertFXSpinLock[i]->Acquire(); if (!m_bQuadDAC8Chan && m_pConfig->GetFXEnabled()) { - m_InsertFXSpinLock[i]->Acquire(); m_InsertFX[i]->process(m_OutputLevel[i][0], m_OutputLevel[i][0], m_OutputLevel[i][0], m_OutputLevel[i][1], nFrames); - m_InsertFXSpinLock[i]->Release(); } + else + { + memcpy(m_OutputLevel[i][1], m_OutputLevel[i][0], nFrames * sizeof(float32_t)); + } + m_InsertFXSpinLock[i]->Release(); } // wait for cores 2 and 3 to complete their work diff --git a/src/minidexed.ini b/src/minidexed.ini index 5b6b13d..de8f362 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -12,6 +12,8 @@ DACI2CAddress=0 ChannelsSwapped=0 # Engine Type ( 1=Modern ; 2=Mark I ; 3=OPL ) EngineType=1 +# FXEnabled ( 0=Disable ; 1=Enable) +#FXEnabled=0 # MIDI MIDIBaudRate=31250