Browse Source

Fix WAVEFORM_TRIANGLE at less than 1.0 amplitude

dds
PaulStoffregen 6 years ago
parent
commit
bf96e81da6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      synth_waveform.cpp

+ 2
- 2
synth_waveform.cpp View File

if (phtop == 1 || phtop == 2) { if (phtop == 1 || phtop == 2) {
*bp++ = ((0xFFFF - (ph >> 15)) * magnitude) >> 16; *bp++ = ((0xFFFF - (ph >> 15)) * magnitude) >> 16;
} else { } else {
*bp++ = ((ph >> 15) * magnitude) >> 16;
*bp++ = (((int32_t)ph >> 15) * magnitude) >> 16;
} }
ph += inc; ph += inc;
} }
if (phtop == 1 || phtop == 2) { if (phtop == 1 || phtop == 2) {
*bp++ = ((0xFFFF - (ph >> 15)) * magnitude) >> 16; *bp++ = ((0xFFFF - (ph >> 15)) * magnitude) >> 16;
} else { } else {
*bp++ = ((ph >> 15) * magnitude) >> 16;
*bp++ = (((int32_t)ph >> 15) * magnitude) >> 16;
} }
} }
break; break;

Loading…
Cancel
Save