diff options
-rw-r--r-- | src/synth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/synth.c b/src/synth.c index 0be572d..9c974e5 100644 --- a/src/synth.c +++ b/src/synth.c @@ -30,7 +30,7 @@ static int16_t sample_square(xas_synth *synth) { float duty = synth->duty; if (synth->state == XAS_SYNTH_ACTIVE) { - ret = ((duty * synth->phase) - M_PI) > 0.0? + ret = (synth->phase - (duty * tau)) > 0.0? (int16_t)roundf(synth->gain * (INT16_MAX / 4)): (int16_t)roundf(synth->gain * (INT16_MIN / 4)); |