allow rates down to 1Hz

This commit is contained in:
tildearrow 2022-08-15 22:40:04 -05:00
parent 474dfa2587
commit 5fe661e9a3
2 changed files with 4 additions and 4 deletions

View File

@ -604,7 +604,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
break;
case 0xc0: case 0xc1: case 0xc2: case 0xc3: // set Hz
divider=(double)(((effect&0x3)<<8)|effectVal);
if (divider<10) divider=10;
if (divider<1) divider=1;
cycles=got.rate*pow(2,MASTER_CLOCK_PREC)/divider;
clockDrift=0;
subticks=0;
@ -695,7 +695,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
break;
case 0xf0: // set Hz by tempo
divider=(double)effectVal*2.0/5.0;
if (divider<10) divider=10;
if (divider<1) divider=1;
cycles=got.rate*pow(2,MASTER_CLOCK_PREC)/divider;
clockDrift=0;
subticks=0;
@ -959,7 +959,7 @@ void DivEngine::nextRow() {
bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
bool ret=false;
if (divider<10) divider=10;
if (divider<1) divider=1;
if (lowLatency && !skipping && !inhibitLowLat) {
tickMult=1000/divider;

View File

@ -195,7 +195,7 @@ void FurnaceGUI::drawSongInfo() {
float setHz=tempoView?e->curSubSong->hz*2.5:e->curSubSong->hz;
if (ImGui::InputFloat("##Rate",&setHz,1.0f,1.0f,"%g")) { MARK_MODIFIED
if (tempoView) setHz/=2.5;
if (setHz<10) setHz=10;
if (setHz<1) setHz=1;
if (setHz>999) setHz=999;
e->setSongRate(setHz,setHz<52);
}