Apply logarithmic scaling

To match perceived loudness
pull/842/head
probonopd 2 months ago
parent 46b7174e47
commit 8bcd92e8b3
  1. 15
      src/minidexed.cpp

@ -1786,14 +1786,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)

Loading…
Cancel
Save