Added configuration needed to choose between Modern, OPL and Mark I engines (#443)

* Added Engines Mark I and OPL

* Added Engine selection

* Update config.cpp

* Added selection for Engine Type

* Added Engine Type selection

* Update build.yml

* Fixes

* Reverting to an old commit (I screwed up)

* Small fix

* Small Fixes

* Fix for error when compiling on 64-bit platforms

* Casting of the engine variable corrected

* Changed the way we parse and set the engine type from the config file following @diyelectromusic suggestions

* Fixed a typo

* Update Synth_Dexed commit

* Moved blocks of code around

* Update Synth_Dexed to 8c67f73

https://github.com/probonopd/MiniDexed/issues/403#issuecomment-1455130745

* Update Synth_Dexed to a908f78

https://github.com/probonopd/MiniDexed/discussions/358#discussioncomment-5358731

* Synth_Dexed deb0905

* Add EngineMsfa.o to Makefile

* Don't add EngineMsfa.o here...

* ...but add EngineMsfa.o here

* Fix missing \

* Update build.yml

* Add Synth_Dexed to the submodules update

* Update Synth_Dexed

* Update Synth_Dexed to c9f5274

https://github.com/probonopd/MiniDexed/issues/526#issuecomment-1670217925

---------

Co-authored-by: probonopd <probonopd@users.noreply.github.com>
pull/500/head
Luca 9 months ago committed by GitHub
parent 571816feaa
commit 8a3488021a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Synth_Dexed.mk
  2. 17
      src/config.cpp
  3. 4
      src/config.h
  4. 3
      src/minidexed.cpp
  5. 2
      src/minidexed.ini
  6. 4
      submod.sh

@ -22,6 +22,9 @@ OBJS += \
$(SYNTH_DEXED_DIR)/pitchenv.o \
$(SYNTH_DEXED_DIR)/porta.o \
$(SYNTH_DEXED_DIR)/sin.o \
$(SYNTH_DEXED_DIR)/EngineMkI.o\
$(SYNTH_DEXED_DIR)/EngineOpl.o\
$(SYNTH_DEXED_DIR)/EngineMsfa.o\
$(CMSIS_DSP_SOURCE_DIR)/SupportFunctions/SupportFunctions.o \
$(CMSIS_DSP_SOURCE_DIR)/BasicMathFunctions/BasicMathFunctions.o \
$(CMSIS_DSP_SOURCE_DIR)/FastMathFunctions/FastMathFunctions.o \

@ -21,6 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#include "config.h"
#include "../Synth_Dexed/src/dexed.h"
CConfig::CConfig (FATFS *pFileSystem)
: m_Properties ("minidexed.ini", pFileSystem)
@ -46,6 +47,15 @@ void CConfig::Load (void)
m_nDACI2CAddress = m_Properties.GetNumber ("DACI2CAddress", 0);
m_bChannelsSwapped = m_Properties.GetNumber ("ChannelsSwapped", 0) != 0;
unsigned newEngineType = m_Properties.GetNumber ("EngineType", 1);
if (newEngineType == 2) {
m_EngineType = MKI;
} else if (newEngineType == 3) {
m_EngineType = OPL;
} else {
m_EngineType = MSFA;
}
m_nMIDIBaudRate = m_Properties.GetNumber ("MIDIBaudRate", 31250);
const char *pMIDIThru = m_Properties.GetString ("MIDIThru");
@ -151,6 +161,11 @@ bool CConfig::GetChannelsSwapped (void) const
return m_bChannelsSwapped;
}
unsigned CConfig::GetEngineType (void) const
{
return m_EngineType;
}
unsigned CConfig::GetMIDIBaudRate (void) const
{
return m_nMIDIBaudRate;
@ -400,3 +415,5 @@ bool CConfig::GetPerformanceSelectToLoad (void) const
{
return m_bPerformanceSelectToLoad;
}

@ -69,6 +69,7 @@ public:
unsigned GetChunkSize (void) const;
unsigned GetDACI2CAddress (void) const; // 0 for auto probing
bool GetChannelsSwapped (void) const;
unsigned GetEngineType (void) const;
// MIDI
unsigned GetMIDIBaudRate (void) const;
@ -152,6 +153,7 @@ private:
unsigned m_nChunkSize;
unsigned m_nDACI2CAddress;
bool m_bChannelsSwapped;
unsigned m_EngineType;
unsigned m_nMIDIBaudRate;
std::string m_MIDIThruIn;
@ -212,6 +214,8 @@ private:
bool m_bMIDIDumpEnabled;
bool m_bProfileEnabled;
bool m_bPerformanceSelectToLoad;
};
#endif

@ -93,7 +93,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
m_pTG[i] = new CDexedAdapter (CConfig::MaxNotes, pConfig->GetSampleRate ());
assert (m_pTG[i]);
m_pTG[i]->setEngineType(pConfig->GetEngineType ());
m_pTG[i]->activate ();
}

@ -10,6 +10,8 @@ SampleRate=48000
#ChunkSize=256
DACI2CAddress=0
ChannelsSwapped=0
# Engine Type ( 1=Modern ; 2=Mark I ; 3=OPL )
EngineType=1
# MIDI
MIDIBaudRate=31250

@ -10,4 +10,6 @@ cd -
cd circle-stdlib/libs/circle-newlib
git checkout 48bf91d # needed for circle ec09d7e
cd -
cd Synth_Dexed/
git checkout c9f5274
cd -

Loading…
Cancel
Save