We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 56fa2aa + 91bbed1 commit cd0c960Copy full SHA for cd0c960
adafruit_waveform/sine.py
@@ -41,5 +41,5 @@ def sine_wave(sample_frequency, pitch):
41
length = int(sample_frequency / pitch)
42
b = array.array("H", [0] * length)
43
for i in range(length):
44
- b[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
+ b[i] = int(math.sin(math.pi * 2 * i / length) * ((2 ** 15) - 1) + 2 ** 15)
45
return b
0 commit comments