Updating sysDef; implementing mapVelocity

This commit is contained in:
Kagamiin~ 2023-12-15 14:20:56 -03:00
parent f42332f2c0
commit 403799d1a3
3 changed files with 9 additions and 1 deletions

View file

@ -1019,6 +1019,13 @@ void DivPlatformESFM::notifyInsDeletion(void* ins) {
}
}
int DivPlatformESFM::mapVelocity(int ch, unsigned char vel) {
const int volMax=MAX(1,dispatch(DivCommand(DIV_CMD_GET_VOLMAX,MAX(ch,0))));
double attenDb=40*log10(vel/127);
double attenUnits=attenDb*(8.0/6.0); // negative
return MAX(0,volMax+attenUnits);
}
void DivPlatformESFM::poke(unsigned int addr, unsigned short val) {
immWrite(addr,val);
}