add a full linear pitch mode, part 3

round frequency/period
This commit is contained in:
tildearrow 2022-05-10 23:42:24 -05:00
parent f5dbc37902
commit a7e6323db9

View file

@ -1037,8 +1037,8 @@ int DivEngine::calcFreq(int base, int pitch, bool period, int octave, int pitch2
int nbase=base+pitch+pitch2; int nbase=base+pitch+pitch2;
double fbase=(period?(song.tuning*0.0625):song.tuning)*pow(2.0,(float)(nbase+384)/(128.0*12.0)); double fbase=(period?(song.tuning*0.0625):song.tuning)*pow(2.0,(float)(nbase+384)/(128.0*12.0));
int bf=period? int bf=period?
(clock/fbase)/divider: round((clock/fbase)/divider):
fbase*(divider/clock); round(fbase*(divider/clock));
if (blockBits>0) { if (blockBits>0) {
CONVERT_FNUM_BLOCK(bf,blockBits,nbase>>7) CONVERT_FNUM_BLOCK(bf,blockBits,nbase>>7)
} else { } else {