From 7e38721a444195252911506f273fd6b55f88c194 Mon Sep 17 00:00:00 2001 From: donluca <51792528+donluca@users.noreply.github.com> Date: Fri, 3 Mar 2023 15:29:06 +0000 Subject: [PATCH 1/8] Added configuration needed to set Velocity Scales --- src/Synth_Dexed.mk | 2 ++ src/config.cpp | 16 ++++++++++++++++ src/config.h | 2 ++ src/minidexed.cpp | 2 ++ src/minidexed.ini | 2 ++ 5 files changed, 24 insertions(+) diff --git a/src/Synth_Dexed.mk b/src/Synth_Dexed.mk index 443d606..a0801df 100644 --- a/src/Synth_Dexed.mk +++ b/src/Synth_Dexed.mk @@ -22,6 +22,8 @@ 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\ $(CMSIS_DSP_SOURCE_DIR)/SupportFunctions/SupportFunctions.o \ $(CMSIS_DSP_SOURCE_DIR)/BasicMathFunctions/BasicMathFunctions.o \ $(CMSIS_DSP_SOURCE_DIR)/FastMathFunctions/FastMathFunctions.o \ diff --git a/src/config.cpp b/src/config.cpp index b5279a8..16571aa 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -21,6 +21,7 @@ // along with this program. If not, see . // #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 newVelocityScale = m_Properties.GetNumber ("VelocityScale", 1); + if (newVelocityScale == 2) { + m_VelocityScale = MIDI_VELOCITY_SCALING_DX7; + } else if (newVelocityScale == 3) { + m_VelocityScale = MIDI_VELOCITY_SCALING_DX7II; + } else { + m_VelocityScale = MIDI_VELOCITY_SCALING_OFF; + } + m_nMIDIBaudRate = m_Properties.GetNumber ("MIDIBaudRate", 31250); const char *pMIDIThru = m_Properties.GetString ("MIDIThru"); @@ -122,6 +132,7 @@ void CConfig::Load (void) m_bMIDIDumpEnabled = m_Properties.GetNumber ("MIDIDumpEnabled", 0) != 0; m_bProfileEnabled = m_Properties.GetNumber ("ProfileEnabled", 0) != 0; m_bPerformanceSelectToLoad = m_Properties.GetNumber ("PerformanceSelectToLoad", 1) != 0; + } const char *CConfig::GetSoundDevice (void) const @@ -149,6 +160,11 @@ bool CConfig::GetChannelsSwapped (void) const return m_bChannelsSwapped; } +unsigned CConfig::GetVelocityScale (void) const +{ + return m_VelocityScale; +} + unsigned CConfig::GetMIDIBaudRate (void) const { return m_nMIDIBaudRate; diff --git a/src/config.h b/src/config.h index 8a34239..e5d56d9 100644 --- a/src/config.h +++ b/src/config.h @@ -69,6 +69,7 @@ public: unsigned GetChunkSize (void) const; unsigned GetDACI2CAddress (void) const; // 0 for auto probing bool GetChannelsSwapped (void) const; + unsigned GetVelocityScale (void) const; // MIDI unsigned GetMIDIBaudRate (void) const; @@ -150,6 +151,7 @@ private: unsigned m_nChunkSize; unsigned m_nDACI2CAddress; bool m_bChannelsSwapped; + unsigned m_VelocityScale; unsigned m_nMIDIBaudRate; std::string m_MIDIThruIn; diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 6a3897e..a1aad1c 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -93,6 +93,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, m_pTG[i] = new CDexedAdapter (CConfig::MaxNotes, pConfig->GetSampleRate ()); assert (m_pTG[i]); + m_pTG[i]->setVelocityScale(pConfig->GetVelocityScale ()); + m_pTG[i]->activate (); } diff --git a/src/minidexed.ini b/src/minidexed.ini index bb3edd7..e230fae 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -10,6 +10,8 @@ SampleRate=48000 #ChunkSize=256 DACI2CAddress=0 ChannelsSwapped=0 +# VelocityScale: 0=OFF 1=DX7 2=DX7II +VelocityScale=0 # MIDI MIDIBaudRate=31250 From 653acc7ddce597a31e4cc81feeff7cfc713741cc Mon Sep 17 00:00:00 2001 From: donluca <51792528+donluca@users.noreply.github.com> Date: Fri, 3 Mar 2023 16:03:13 +0000 Subject: [PATCH 2/8] Small fixes --- src/config.cpp | 6 +++--- src/minidexed.ini | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 16571aa..d7d0980 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -47,10 +47,10 @@ void CConfig::Load (void) m_nDACI2CAddress = m_Properties.GetNumber ("DACI2CAddress", 0); m_bChannelsSwapped = m_Properties.GetNumber ("ChannelsSwapped", 0) != 0; - unsigned newVelocityScale = m_Properties.GetNumber ("VelocityScale", 1); - if (newVelocityScale == 2) { + unsigned newVelocityScale = m_Properties.GetNumber ("VelocityScale", 0); + if (newVelocityScale == 1) { m_VelocityScale = MIDI_VELOCITY_SCALING_DX7; - } else if (newVelocityScale == 3) { + } else if (newVelocityScale == 2) { m_VelocityScale = MIDI_VELOCITY_SCALING_DX7II; } else { m_VelocityScale = MIDI_VELOCITY_SCALING_OFF; diff --git a/src/minidexed.ini b/src/minidexed.ini index e230fae..e235ad7 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -10,8 +10,8 @@ SampleRate=48000 #ChunkSize=256 DACI2CAddress=0 ChannelsSwapped=0 -# VelocityScale: 0=OFF 1=DX7 2=DX7II -VelocityScale=0 +# VelocityScale ( 0=OFF ; 1=DX7 ; 2=DX7II ) +VelocityScale=0 # MIDI MIDIBaudRate=31250 From b6778f8e7dabce1b3172a0c3a509ffcfa4917824 Mon Sep 17 00:00:00 2001 From: donluca <51792528+donluca@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:41:36 +0100 Subject: [PATCH 3/8] Update build.yml --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ee4ebb..25f2690 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,12 @@ jobs: cd circle-stdlib/libs/circle-newlib git checkout 48bf91d # needed for circle ec09d7e cd - + - name: Change Synth_Dexed branch to enable selection of Engine Types + run: | + set -ex + cd Synth_Dexed/ + git checkout 8a4c373 + cd - - name: Install toolchains run: | set -ex From 5b194adaae0c1a37a959f1a8169b24b5c3dc8304 Mon Sep 17 00:00:00 2001 From: donluca <51792528+donluca@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:44:05 +0100 Subject: [PATCH 4/8] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25f2690..85e2237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: cd circle-stdlib/libs/circle-newlib git checkout 48bf91d # needed for circle ec09d7e cd - - - name: Change Synth_Dexed branch to enable selection of Engine Types + - name: Change Synth_Dexed branch to enable selection of Velocity Scales run: | set -ex cd Synth_Dexed/ From 0d3ed2ba3e4c6eab824dd0ee0279382a73b5ddb8 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 5 Mar 2023 17:44:19 +0100 Subject: [PATCH 5/8] Update Synth_Dexed to 8c67f73 https://github.com/probonopd/MiniDexed/issues/403#issuecomment-1455130745 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85e2237..54439b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: run: | set -ex cd Synth_Dexed/ - git checkout 8a4c373 + git checkout 8c67f73 cd - - name: Install toolchains run: | From 8a503255db40b741692b665d7f8dc71cb930f117 Mon Sep 17 00:00:00 2001 From: Luca <51792528+donluca@users.noreply.github.com> Date: Wed, 22 Mar 2023 16:19:33 +0100 Subject: [PATCH 6/8] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54439b4..22658f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: run: | set -ex cd Synth_Dexed/ - git checkout 8c67f73 + git checkout deb0905 cd - - name: Install toolchains run: | From e891ec8d2e618d31329d2d7967f3490c019b851a Mon Sep 17 00:00:00 2001 From: Luca <51792528+donluca@users.noreply.github.com> Date: Wed, 22 Mar 2023 16:31:50 +0100 Subject: [PATCH 7/8] Update Synth_Dexed.mk --- src/Synth_Dexed.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Synth_Dexed.mk b/src/Synth_Dexed.mk index a0801df..6aa4a49 100644 --- a/src/Synth_Dexed.mk +++ b/src/Synth_Dexed.mk @@ -24,6 +24,7 @@ OBJS += \ $(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 \ From f3e5bc9dcf71bb0bceba41835f5353e88e194746 Mon Sep 17 00:00:00 2001 From: probonopd Date: Fri, 7 Apr 2023 23:32:59 +0200 Subject: [PATCH 8/8] Also pin Synth_Dexed --- submod.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/submod.sh b/submod.sh index e941660..3021111 100755 --- a/submod.sh +++ b/submod.sh @@ -10,4 +10,6 @@ cd - cd circle-stdlib/libs/circle-newlib git checkout 48bf91d # needed for circle ec09d7e cd - - +cd Synth_Dexed/ +git checkout deb0905 +cd -