diff --git a/src/config.cpp b/src/config.cpp index 526d8ad7..3d1b694b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -49,7 +49,16 @@ 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); + unsigned newVelocityScale = m_Properties.GetNumber ("VelocityScale", 0); + if (newVelocityScale == 1) { + m_VelocityScale = MIDI_VELOCITY_SCALING_DX7; + } else if (newVelocityScale == 2) { + m_VelocityScale = MIDI_VELOCITY_SCALING_DX7II; + } else { + m_VelocityScale = MIDI_VELOCITY_SCALING_OFF; + } + + unsigned newEngineType = m_Properties.GetNumber ("EngineType", 1); if (newEngineType == 2) { m_EngineType = MKI; } else if (newEngineType == 3) { @@ -58,6 +67,7 @@ void CConfig::Load (void) m_EngineType = MSFA; } + m_nMIDIBaudRate = m_Properties.GetNumber ("MIDIBaudRate", 31250); const char *pMIDIThru = m_Properties.GetString ("MIDIThru"); @@ -151,6 +161,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; + m_bPerformanceSelectChannel = m_Properties.GetNumber ("PerformanceSelectChannel", 0); } @@ -184,6 +195,11 @@ bool CConfig::GetChannelsSwapped (void) const return m_bChannelsSwapped; } +unsigned CConfig::GetVelocityScale (void) const +{ + return m_VelocityScale; +} + unsigned CConfig::GetEngineType (void) const { return m_EngineType; diff --git a/src/config.h b/src/config.h index f83c177b..431e479b 100644 --- a/src/config.h +++ b/src/config.h @@ -72,8 +72,12 @@ class CConfig // Configuration for MiniDexed unsigned GetChunkSize (void) const; unsigned GetDACI2CAddress (void) const; // 0 for auto probing bool GetChannelsSwapped (void) const; + + unsigned GetVelocityScale (void) const; + unsigned GetEngineType (void) const; + // MIDI unsigned GetMIDIBaudRate (void) const; const char *GetMIDIThruIn (void) const; // "" if not specified @@ -178,6 +182,9 @@ class CConfig // Configuration for MiniDexed unsigned m_nChunkSize; unsigned m_nDACI2CAddress; bool m_bChannelsSwapped; + + unsigned m_VelocityScale; + unsigned m_EngineType; unsigned m_nMIDIBaudRate; diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 71b72476..220e877e 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -93,8 +93,11 @@ 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]->setEngineType(pConfig->GetEngineType ()); + m_pTG[i]->activate (); } diff --git a/src/minidexed.ini b/src/minidexed.ini index cd5ea1a3..12e6cfd5 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 # Engine Type ( 1=Modern ; 2=Mark I ; 3=OPL ) EngineType=1