implement loop modality and pitch control flags

issue #113
This commit is contained in:
tildearrow 2022-02-03 00:52:50 -05:00
parent 3379e8b380
commit 2a15673610
2 changed files with 10 additions and 3 deletions

View file

@ -4749,9 +4749,14 @@ int DivEngine::calcBaseFreq(double clock, double divider, int note, bool period)
}
int DivEngine::calcFreq(int base, int pitch, bool period) {
if (song.linearPitch) {
return period?
int(base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0):
(int(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98);
}
return period?
int(base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0):
(int(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98);
base-pitch:
base+pitch;
}
void DivEngine::play() {

View file

@ -830,7 +830,9 @@ bool DivEngine::nextTick(bool noAccum) {
if (--ticks<=0) {
ret=endOfSong;
if (endOfSong) {
playSub(true);
if (song.loopModality!=2) {
playSub(true);
}
}
endOfSong=false;
nextRow();