implement getGain for a couple chips

the ones with log volume
This commit is contained in:
tildearrow 2024-07-22 19:08:39 -05:00
parent b108156954
commit b2223ccd0f
17 changed files with 65 additions and 1 deletions

View file

@ -2140,6 +2140,11 @@ int DivPlatformOPL::mapVelocity(int ch, float vel) {
return CLAMP(round(64.0-(56.0-log2(vel*127.0)*8.0)),0,63);
}
float DivPlatformOPL::getGain(int ch, int vol) {
if (vol==0) return 0;
return 1.0/pow(10.0,(float)(63-vol)*0.75/20.0);
}
unsigned char* DivPlatformOPL::getRegisterPool() {
return regPool;
}