WaveSynth: fix phase modulation

fixes #481
This commit is contained in:
tildearrow 2022-05-25 00:34:35 -05:00
parent 42a082b2a7
commit 93a4e3d688

View file

@ -186,7 +186,7 @@ bool DivWaveSynth::tick(bool skipSubDiv) {
break; break;
case DIV_WS_PHASE_MOD: case DIV_WS_PHASE_MOD:
for (int i=0; i<=state.speed; i++) { for (int i=0; i<=state.speed; i++) {
int mod=(wave2[pos]*(state.param2-stage))>>8; int mod=(wave2[pos]*(state.param2-stage))/((height+1)*2);
output[pos]=wave1[(pos+mod)%width]; output[pos]=wave1[(pos+mod)%width];
if (++pos>=width) { if (++pos>=width) {
pos=0; pos=0;