Browse code

calculate NOTE_PERIOD based on sampling rate (thanks asie)

Sigrid Solveig Haflínudóttir authored on 19/05/2021 07:30:39
Showing 1 changed files
... ...
@@ -13,7 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 13
 WITH REGARD TO THIS SOFTWARE.
14 14
 */
15 15
 
16
-#define NOTE_PERIOD 0x10000
16
+#define NOTE_PERIOD (SAMPLE_FREQUENCY * 0x4000 / 11025)
17 17
 #define ADSR_STEP (SAMPLE_FREQUENCY / 0xf)
18 18
 
19 19
 /* clang-format off */