Skip to content

Commit 2d15db3

Browse files
authored
Formula correction
The stated formula for converting midi-notes to frequency is wrong – the base and exponent of the second factor should be interchanged
1 parent 4e60678 commit 2d15db3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/AnalogWave/examples/DACEqualTemperedScale/DACEqualTemperedScale.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
a formula for converting MIDI note numbers (0-127) to pitches. This sketch
99
reduces that to the notes 21 - 108, which are the 88 keys found on a piano:
1010
11-
frequency = 440 * ((noteNumber - 69) / 12.0)^2
11+
frequency = 440 * 2^((noteNumber - 69) / 12.0)
1212
1313
You can see this applied in the code below.
1414

0 commit comments

Comments
 (0)