mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +00:00
add a full linear pitch mode, part 3
round frequency/period
This commit is contained in:
parent
f5dbc37902
commit
a7e6323db9
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue