Merge branch 'main' into performance-menu

performance-menu
probonopd 4 days ago committed by GitHub
commit 53c00590bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      src/config.cpp
  2. 4
      src/config.h
  3. 18
      src/minidexed.cpp
  4. 2
      src/minidexed.ini

@ -200,6 +200,8 @@ void CConfig::Load (void)
m_bProfileEnabled = m_Properties.GetNumber ("ProfileEnabled", 0) != 0;
m_bPerformanceSelectToLoad = m_Properties.GetNumber ("PerformanceSelectToLoad", 1) != 0;
m_bPerformanceSelectChannel = m_Properties.GetNumber ("PerformanceSelectChannel", 0);
m_nMasterVolume = m_Properties.GetNumber ("MasterVolume", 64);
}
unsigned CConfig::GetToneGenerators (void) const

@ -239,6 +239,8 @@ public:
bool GetPerformanceSelectToLoad (void) const;
unsigned GetPerformanceSelectChannel (void) const;
unsigned GetMasterVolume() const { return m_nMasterVolume; }
private:
CPropertiesFatFsFile m_Properties;
@ -353,6 +355,8 @@ private:
bool m_bProfileEnabled;
bool m_bPerformanceSelectToLoad;
unsigned m_bPerformanceSelectChannel;
unsigned m_nMasterVolume; // Master volume 0-127
};
#endif

@ -218,7 +218,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
}
#endif
setMasterVolume(1.0);
float masterVolNorm = (float)(pConfig->GetMasterVolume()) / 127.0f;
setMasterVolume(masterVolNorm);
// BEGIN setup tg_mixer
tg_mixer = new AudioStereoMixer<CConfig::AllToneGenerators>(pConfig->GetChunkSize()/2);
@ -1800,14 +1801,17 @@ void CMiniDexed::getSysExVoiceDump(uint8_t* dest, uint8_t nTG)
dest[162] = 0xF7; // SysEx end
}
void CMiniDexed::setMasterVolume (float32_t vol)
void CMiniDexed::setMasterVolume(float32_t vol)
{
if(vol < 0.0)
vol = 0.0;
else if(vol > 1.0)
vol = 1.0;
if (vol < 0.0)
vol = 0.0;
else if (vol > 1.0)
vol = 1.0;
nMasterVolume=vol;
// Apply logarithmic scaling to match perceived loudness
vol = powf(vol, 2.0f);
nMasterVolume = vol;
}
std::string CMiniDexed::GetPerformanceFileName(unsigned nID)

@ -13,6 +13,8 @@ ChannelsSwapped=0
# Engine Type ( 1=Modern ; 2=Mark I ; 3=OPL )
EngineType=1
QuadDAC8Chan=0
# Master Volume (0-127)
MasterVolume=64
# MIDI
MIDIBaudRate=31250

Loading…
Cancel
Save