Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings to set velocity scale #446

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/minidexed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}

Expand Down
2 changes: 2 additions & 0 deletions src/minidexed.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading