OPL and OPLL vol map

This commit is contained in:
tildearrow 2023-12-17 14:54:38 -05:00
parent 8d30ac4d3b
commit 0208883fa1
6 changed files with 26 additions and 2 deletions

View file

@ -962,6 +962,13 @@ DivDispatchOscBuffer* DivPlatformOPLL::getOscBuffer(int ch) {
return oscBuf[ch];
}
int DivPlatformOPLL::mapVelocity(int ch, float vel) {
// -3dB per step
if (vel==0) return 0;
if (vel>=1.0) return 15;
return CLAMP(round(16.0-(14.0-log2(vel*127.0)*2.0)),0,15);
}
unsigned char* DivPlatformOPLL::getRegisterPool() {
return regPool;
}