diff --git a/app/src/main/cpp/waveforms/Sawtooth.cpp b/app/src/main/cpp/waveforms/Sawtooth.cpp index 630d335..3bfe814 100644 --- a/app/src/main/cpp/waveforms/Sawtooth.cpp +++ b/app/src/main/cpp/waveforms/Sawtooth.cpp @@ -5,7 +5,7 @@ } void Sawtooth::setFrequency(float frequency) { - step = frequency / (double) host->sampleRate; + step = 2 * frequency / (double) host->sampleRate; } void Sawtooth::render(float *data, uint32_t frameCount) { @@ -13,7 +13,7 @@ data[i] += value * amplitude; value += step; if (value > 1) { - value = 0; + value = -1; } } }