wave synth work

now there is a preview
This commit is contained in:
tildearrow 2022-05-21 18:36:15 -05:00
parent 61916be495
commit 367d14357c
7 changed files with 109 additions and 13 deletions

View file

@ -390,6 +390,7 @@ enum DivWaveSynthEffects {
DIV_WS_SUBTRACT,
DIV_WS_AVERAGE,
DIV_WS_PHASE,
DIV_WS_CHORUS,
DIV_WS_SINGLE_MAX,
@ -400,7 +401,9 @@ enum DivWaveSynthEffects {
DIV_WS_PING_PONG,
DIV_WS_OVERLAY,
DIV_WS_NEGATIVE_OVERLAY,
DIV_WS_PHASE_DUAL,
DIV_WS_SLIDE,
DIV_WS_MIX,
DIV_WS_PHASE_MOD,
DIV_WS_DUAL_MAX
};

View file

@ -84,6 +84,17 @@ bool DivWaveSynth::tick() {
}
updated=true;
break;
case DIV_WS_CHORUS:
for (int i=0; i<=state.speed; i++) {
output[pos]=(wave1[pos]+wave1[(pos+stage)%width])>>1;
if (++pos>=width) {
pos=0;
stage+=state.param1;
while (stage>=width) stage-=width;
}
}
updated=true;
break;
case DIV_WS_WIPE:
for (int i=0; i<=state.speed; i++) {
output[pos]=(stage&1)?wave1[pos]:wave2[pos];
@ -145,7 +156,20 @@ bool DivWaveSynth::tick() {
}
updated=true;
break;
case DIV_WS_PHASE_DUAL:
case DIV_WS_SLIDE:
break;
case DIV_WS_MIX:
for (int i=0; i<=state.speed; i++) {
output[pos]=(wave1[pos]+wave2[(pos+stage)%width])>>1;
if (++pos>=width) {
pos=0;
stage+=state.param1;
while (stage>=width) stage-=width;
}
}
updated=true;
break;
case DIV_WS_PHASE_MOD:
break;
}
divCounter=state.rateDivider;