فهرست منبع

library update

Oliver Fabel 1 سال پیش
والد
کامیت
ed9bfabffa
1فایلهای تغییر یافته به همراه109 افزوده شده و 109 حذف شده
  1. 109 109
      mp_flipper_modflipperzero.h

+ 109 - 109
mp_flipper_modflipperzero.h

@@ -55,118 +55,118 @@ cf: float = 2 ** (1.0 / 12)
 note: float = base_note
 for octave in range(9):
     for name in note_names:
-        print(f"#define MP_FLIPPER_SPEAKER_NOTE_{name}{octave} {round(note, 2)}")
+        print(f"#define MP_FLIPPER_SPEAKER_NOTE_{name}{octave} MICROPY_FLOAT_CONST({round(note, 2)})")
         note = note * cf
 */
 
-#define MP_FLIPPER_SPEAKER_NOTE_C0 16.35
-#define MP_FLIPPER_SPEAKER_NOTE_CS0 17.32
-#define MP_FLIPPER_SPEAKER_NOTE_D0 18.35
-#define MP_FLIPPER_SPEAKER_NOTE_DS0 19.45
-#define MP_FLIPPER_SPEAKER_NOTE_E0 20.6
-#define MP_FLIPPER_SPEAKER_NOTE_F0 21.83
-#define MP_FLIPPER_SPEAKER_NOTE_FS0 23.12
-#define MP_FLIPPER_SPEAKER_NOTE_G0 24.5
-#define MP_FLIPPER_SPEAKER_NOTE_GS0 25.96
-#define MP_FLIPPER_SPEAKER_NOTE_A0 27.5
-#define MP_FLIPPER_SPEAKER_NOTE_AS0 29.14
-#define MP_FLIPPER_SPEAKER_NOTE_B0 30.87
-#define MP_FLIPPER_SPEAKER_NOTE_C1 32.7
-#define MP_FLIPPER_SPEAKER_NOTE_CS1 34.65
-#define MP_FLIPPER_SPEAKER_NOTE_D1 36.71
-#define MP_FLIPPER_SPEAKER_NOTE_DS1 38.89
-#define MP_FLIPPER_SPEAKER_NOTE_E1 41.2
-#define MP_FLIPPER_SPEAKER_NOTE_F1 43.65
-#define MP_FLIPPER_SPEAKER_NOTE_FS1 46.25
-#define MP_FLIPPER_SPEAKER_NOTE_G1 49.0
-#define MP_FLIPPER_SPEAKER_NOTE_GS1 51.91
-#define MP_FLIPPER_SPEAKER_NOTE_A1 55.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS1 58.27
-#define MP_FLIPPER_SPEAKER_NOTE_B1 61.74
-#define MP_FLIPPER_SPEAKER_NOTE_C2 65.41
-#define MP_FLIPPER_SPEAKER_NOTE_CS2 69.3
-#define MP_FLIPPER_SPEAKER_NOTE_D2 73.42
-#define MP_FLIPPER_SPEAKER_NOTE_DS2 77.78
-#define MP_FLIPPER_SPEAKER_NOTE_E2 82.41
-#define MP_FLIPPER_SPEAKER_NOTE_F2 87.31
-#define MP_FLIPPER_SPEAKER_NOTE_FS2 92.5
-#define MP_FLIPPER_SPEAKER_NOTE_G2 98.0
-#define MP_FLIPPER_SPEAKER_NOTE_GS2 103.83
-#define MP_FLIPPER_SPEAKER_NOTE_A2 110.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS2 116.54
-#define MP_FLIPPER_SPEAKER_NOTE_B2 123.47
-#define MP_FLIPPER_SPEAKER_NOTE_C3 130.81
-#define MP_FLIPPER_SPEAKER_NOTE_CS3 138.59
-#define MP_FLIPPER_SPEAKER_NOTE_D3 146.83
-#define MP_FLIPPER_SPEAKER_NOTE_DS3 155.56
-#define MP_FLIPPER_SPEAKER_NOTE_E3 164.81
-#define MP_FLIPPER_SPEAKER_NOTE_F3 174.61
-#define MP_FLIPPER_SPEAKER_NOTE_FS3 185.0
-#define MP_FLIPPER_SPEAKER_NOTE_G3 196.0
-#define MP_FLIPPER_SPEAKER_NOTE_GS3 207.65
-#define MP_FLIPPER_SPEAKER_NOTE_A3 220.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS3 233.08
-#define MP_FLIPPER_SPEAKER_NOTE_B3 246.94
-#define MP_FLIPPER_SPEAKER_NOTE_C4 261.63
-#define MP_FLIPPER_SPEAKER_NOTE_CS4 277.18
-#define MP_FLIPPER_SPEAKER_NOTE_D4 293.66
-#define MP_FLIPPER_SPEAKER_NOTE_DS4 311.13
-#define MP_FLIPPER_SPEAKER_NOTE_E4 329.63
-#define MP_FLIPPER_SPEAKER_NOTE_F4 349.23
-#define MP_FLIPPER_SPEAKER_NOTE_FS4 369.99
-#define MP_FLIPPER_SPEAKER_NOTE_G4 392.0
-#define MP_FLIPPER_SPEAKER_NOTE_GS4 415.3
-#define MP_FLIPPER_SPEAKER_NOTE_A4 440.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS4 466.16
-#define MP_FLIPPER_SPEAKER_NOTE_B4 493.88
-#define MP_FLIPPER_SPEAKER_NOTE_C5 523.25
-#define MP_FLIPPER_SPEAKER_NOTE_CS5 554.37
-#define MP_FLIPPER_SPEAKER_NOTE_D5 587.33
-#define MP_FLIPPER_SPEAKER_NOTE_DS5 622.25
-#define MP_FLIPPER_SPEAKER_NOTE_E5 659.26
-#define MP_FLIPPER_SPEAKER_NOTE_F5 698.46
-#define MP_FLIPPER_SPEAKER_NOTE_FS5 739.99
-#define MP_FLIPPER_SPEAKER_NOTE_G5 783.99
-#define MP_FLIPPER_SPEAKER_NOTE_GS5 830.61
-#define MP_FLIPPER_SPEAKER_NOTE_A5 880.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS5 932.33
-#define MP_FLIPPER_SPEAKER_NOTE_B5 987.77
-#define MP_FLIPPER_SPEAKER_NOTE_C6 1046.5
-#define MP_FLIPPER_SPEAKER_NOTE_CS6 1108.73
-#define MP_FLIPPER_SPEAKER_NOTE_D6 1174.66
-#define MP_FLIPPER_SPEAKER_NOTE_DS6 1244.51
-#define MP_FLIPPER_SPEAKER_NOTE_E6 1318.51
-#define MP_FLIPPER_SPEAKER_NOTE_F6 1396.91
-#define MP_FLIPPER_SPEAKER_NOTE_FS6 1479.98
-#define MP_FLIPPER_SPEAKER_NOTE_G6 1567.98
-#define MP_FLIPPER_SPEAKER_NOTE_GS6 1661.22
-#define MP_FLIPPER_SPEAKER_NOTE_A6 1760.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS6 1864.66
-#define MP_FLIPPER_SPEAKER_NOTE_B6 1975.53
-#define MP_FLIPPER_SPEAKER_NOTE_C7 2093.0
-#define MP_FLIPPER_SPEAKER_NOTE_CS7 2217.46
-#define MP_FLIPPER_SPEAKER_NOTE_D7 2349.32
-#define MP_FLIPPER_SPEAKER_NOTE_DS7 2489.02
-#define MP_FLIPPER_SPEAKER_NOTE_E7 2637.02
-#define MP_FLIPPER_SPEAKER_NOTE_F7 2793.83
-#define MP_FLIPPER_SPEAKER_NOTE_FS7 2959.96
-#define MP_FLIPPER_SPEAKER_NOTE_G7 3135.96
-#define MP_FLIPPER_SPEAKER_NOTE_GS7 3322.44
-#define MP_FLIPPER_SPEAKER_NOTE_A7 3520.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS7 3729.31
-#define MP_FLIPPER_SPEAKER_NOTE_B7 3951.07
-#define MP_FLIPPER_SPEAKER_NOTE_C8 4186.01
-#define MP_FLIPPER_SPEAKER_NOTE_CS8 4434.92
-#define MP_FLIPPER_SPEAKER_NOTE_D8 4698.64
-#define MP_FLIPPER_SPEAKER_NOTE_DS8 4978.03
-#define MP_FLIPPER_SPEAKER_NOTE_E8 5274.04
-#define MP_FLIPPER_SPEAKER_NOTE_F8 5587.65
-#define MP_FLIPPER_SPEAKER_NOTE_FS8 5919.91
-#define MP_FLIPPER_SPEAKER_NOTE_G8 6271.93
-#define MP_FLIPPER_SPEAKER_NOTE_GS8 6644.88
-#define MP_FLIPPER_SPEAKER_NOTE_A8 7040.0
-#define MP_FLIPPER_SPEAKER_NOTE_AS8 7458.62
-#define MP_FLIPPER_SPEAKER_NOTE_B8 7902.13
+#define MP_FLIPPER_SPEAKER_NOTE_C0 MICROPY_FLOAT_CONST(16.35)
+#define MP_FLIPPER_SPEAKER_NOTE_CS0 MICROPY_FLOAT_CONST(17.32)
+#define MP_FLIPPER_SPEAKER_NOTE_D0 MICROPY_FLOAT_CONST(18.35)
+#define MP_FLIPPER_SPEAKER_NOTE_DS0 MICROPY_FLOAT_CONST(19.45)
+#define MP_FLIPPER_SPEAKER_NOTE_E0 MICROPY_FLOAT_CONST(20.6)
+#define MP_FLIPPER_SPEAKER_NOTE_F0 MICROPY_FLOAT_CONST(21.83)
+#define MP_FLIPPER_SPEAKER_NOTE_FS0 MICROPY_FLOAT_CONST(23.12)
+#define MP_FLIPPER_SPEAKER_NOTE_G0 MICROPY_FLOAT_CONST(24.5)
+#define MP_FLIPPER_SPEAKER_NOTE_GS0 MICROPY_FLOAT_CONST(25.96)
+#define MP_FLIPPER_SPEAKER_NOTE_A0 MICROPY_FLOAT_CONST(27.5)
+#define MP_FLIPPER_SPEAKER_NOTE_AS0 MICROPY_FLOAT_CONST(29.14)
+#define MP_FLIPPER_SPEAKER_NOTE_B0 MICROPY_FLOAT_CONST(30.87)
+#define MP_FLIPPER_SPEAKER_NOTE_C1 MICROPY_FLOAT_CONST(32.7)
+#define MP_FLIPPER_SPEAKER_NOTE_CS1 MICROPY_FLOAT_CONST(34.65)
+#define MP_FLIPPER_SPEAKER_NOTE_D1 MICROPY_FLOAT_CONST(36.71)
+#define MP_FLIPPER_SPEAKER_NOTE_DS1 MICROPY_FLOAT_CONST(38.89)
+#define MP_FLIPPER_SPEAKER_NOTE_E1 MICROPY_FLOAT_CONST(41.2)
+#define MP_FLIPPER_SPEAKER_NOTE_F1 MICROPY_FLOAT_CONST(43.65)
+#define MP_FLIPPER_SPEAKER_NOTE_FS1 MICROPY_FLOAT_CONST(46.25)
+#define MP_FLIPPER_SPEAKER_NOTE_G1 MICROPY_FLOAT_CONST(49.0)
+#define MP_FLIPPER_SPEAKER_NOTE_GS1 MICROPY_FLOAT_CONST(51.91)
+#define MP_FLIPPER_SPEAKER_NOTE_A1 MICROPY_FLOAT_CONST(55.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS1 MICROPY_FLOAT_CONST(58.27)
+#define MP_FLIPPER_SPEAKER_NOTE_B1 MICROPY_FLOAT_CONST(61.74)
+#define MP_FLIPPER_SPEAKER_NOTE_C2 MICROPY_FLOAT_CONST(65.41)
+#define MP_FLIPPER_SPEAKER_NOTE_CS2 MICROPY_FLOAT_CONST(69.3)
+#define MP_FLIPPER_SPEAKER_NOTE_D2 MICROPY_FLOAT_CONST(73.42)
+#define MP_FLIPPER_SPEAKER_NOTE_DS2 MICROPY_FLOAT_CONST(77.78)
+#define MP_FLIPPER_SPEAKER_NOTE_E2 MICROPY_FLOAT_CONST(82.41)
+#define MP_FLIPPER_SPEAKER_NOTE_F2 MICROPY_FLOAT_CONST(87.31)
+#define MP_FLIPPER_SPEAKER_NOTE_FS2 MICROPY_FLOAT_CONST(92.5)
+#define MP_FLIPPER_SPEAKER_NOTE_G2 MICROPY_FLOAT_CONST(98.0)
+#define MP_FLIPPER_SPEAKER_NOTE_GS2 MICROPY_FLOAT_CONST(103.83)
+#define MP_FLIPPER_SPEAKER_NOTE_A2 MICROPY_FLOAT_CONST(110.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS2 MICROPY_FLOAT_CONST(116.54)
+#define MP_FLIPPER_SPEAKER_NOTE_B2 MICROPY_FLOAT_CONST(123.47)
+#define MP_FLIPPER_SPEAKER_NOTE_C3 MICROPY_FLOAT_CONST(130.81)
+#define MP_FLIPPER_SPEAKER_NOTE_CS3 MICROPY_FLOAT_CONST(138.59)
+#define MP_FLIPPER_SPEAKER_NOTE_D3 MICROPY_FLOAT_CONST(146.83)
+#define MP_FLIPPER_SPEAKER_NOTE_DS3 MICROPY_FLOAT_CONST(155.56)
+#define MP_FLIPPER_SPEAKER_NOTE_E3 MICROPY_FLOAT_CONST(164.81)
+#define MP_FLIPPER_SPEAKER_NOTE_F3 MICROPY_FLOAT_CONST(174.61)
+#define MP_FLIPPER_SPEAKER_NOTE_FS3 MICROPY_FLOAT_CONST(185.0)
+#define MP_FLIPPER_SPEAKER_NOTE_G3 MICROPY_FLOAT_CONST(196.0)
+#define MP_FLIPPER_SPEAKER_NOTE_GS3 MICROPY_FLOAT_CONST(207.65)
+#define MP_FLIPPER_SPEAKER_NOTE_A3 MICROPY_FLOAT_CONST(220.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS3 MICROPY_FLOAT_CONST(233.08)
+#define MP_FLIPPER_SPEAKER_NOTE_B3 MICROPY_FLOAT_CONST(246.94)
+#define MP_FLIPPER_SPEAKER_NOTE_C4 MICROPY_FLOAT_CONST(261.63)
+#define MP_FLIPPER_SPEAKER_NOTE_CS4 MICROPY_FLOAT_CONST(277.18)
+#define MP_FLIPPER_SPEAKER_NOTE_D4 MICROPY_FLOAT_CONST(293.66)
+#define MP_FLIPPER_SPEAKER_NOTE_DS4 MICROPY_FLOAT_CONST(311.13)
+#define MP_FLIPPER_SPEAKER_NOTE_E4 MICROPY_FLOAT_CONST(329.63)
+#define MP_FLIPPER_SPEAKER_NOTE_F4 MICROPY_FLOAT_CONST(349.23)
+#define MP_FLIPPER_SPEAKER_NOTE_FS4 MICROPY_FLOAT_CONST(369.99)
+#define MP_FLIPPER_SPEAKER_NOTE_G4 MICROPY_FLOAT_CONST(392.0)
+#define MP_FLIPPER_SPEAKER_NOTE_GS4 MICROPY_FLOAT_CONST(415.3)
+#define MP_FLIPPER_SPEAKER_NOTE_A4 MICROPY_FLOAT_CONST(440.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS4 MICROPY_FLOAT_CONST(466.16)
+#define MP_FLIPPER_SPEAKER_NOTE_B4 MICROPY_FLOAT_CONST(493.88)
+#define MP_FLIPPER_SPEAKER_NOTE_C5 MICROPY_FLOAT_CONST(523.25)
+#define MP_FLIPPER_SPEAKER_NOTE_CS5 MICROPY_FLOAT_CONST(554.37)
+#define MP_FLIPPER_SPEAKER_NOTE_D5 MICROPY_FLOAT_CONST(587.33)
+#define MP_FLIPPER_SPEAKER_NOTE_DS5 MICROPY_FLOAT_CONST(622.25)
+#define MP_FLIPPER_SPEAKER_NOTE_E5 MICROPY_FLOAT_CONST(659.26)
+#define MP_FLIPPER_SPEAKER_NOTE_F5 MICROPY_FLOAT_CONST(698.46)
+#define MP_FLIPPER_SPEAKER_NOTE_FS5 MICROPY_FLOAT_CONST(739.99)
+#define MP_FLIPPER_SPEAKER_NOTE_G5 MICROPY_FLOAT_CONST(783.99)
+#define MP_FLIPPER_SPEAKER_NOTE_GS5 MICROPY_FLOAT_CONST(830.61)
+#define MP_FLIPPER_SPEAKER_NOTE_A5 MICROPY_FLOAT_CONST(880.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS5 MICROPY_FLOAT_CONST(932.33)
+#define MP_FLIPPER_SPEAKER_NOTE_B5 MICROPY_FLOAT_CONST(987.77)
+#define MP_FLIPPER_SPEAKER_NOTE_C6 MICROPY_FLOAT_CONST(1046.5)
+#define MP_FLIPPER_SPEAKER_NOTE_CS6 MICROPY_FLOAT_CONST(1108.73)
+#define MP_FLIPPER_SPEAKER_NOTE_D6 MICROPY_FLOAT_CONST(1174.66)
+#define MP_FLIPPER_SPEAKER_NOTE_DS6 MICROPY_FLOAT_CONST(1244.51)
+#define MP_FLIPPER_SPEAKER_NOTE_E6 MICROPY_FLOAT_CONST(1318.51)
+#define MP_FLIPPER_SPEAKER_NOTE_F6 MICROPY_FLOAT_CONST(1396.91)
+#define MP_FLIPPER_SPEAKER_NOTE_FS6 MICROPY_FLOAT_CONST(1479.98)
+#define MP_FLIPPER_SPEAKER_NOTE_G6 MICROPY_FLOAT_CONST(1567.98)
+#define MP_FLIPPER_SPEAKER_NOTE_GS6 MICROPY_FLOAT_CONST(1661.22)
+#define MP_FLIPPER_SPEAKER_NOTE_A6 MICROPY_FLOAT_CONST(1760.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS6 MICROPY_FLOAT_CONST(1864.66)
+#define MP_FLIPPER_SPEAKER_NOTE_B6 MICROPY_FLOAT_CONST(1975.53)
+#define MP_FLIPPER_SPEAKER_NOTE_C7 MICROPY_FLOAT_CONST(2093.0)
+#define MP_FLIPPER_SPEAKER_NOTE_CS7 MICROPY_FLOAT_CONST(2217.46)
+#define MP_FLIPPER_SPEAKER_NOTE_D7 MICROPY_FLOAT_CONST(2349.32)
+#define MP_FLIPPER_SPEAKER_NOTE_DS7 MICROPY_FLOAT_CONST(2489.02)
+#define MP_FLIPPER_SPEAKER_NOTE_E7 MICROPY_FLOAT_CONST(2637.02)
+#define MP_FLIPPER_SPEAKER_NOTE_F7 MICROPY_FLOAT_CONST(2793.83)
+#define MP_FLIPPER_SPEAKER_NOTE_FS7 MICROPY_FLOAT_CONST(2959.96)
+#define MP_FLIPPER_SPEAKER_NOTE_G7 MICROPY_FLOAT_CONST(3135.96)
+#define MP_FLIPPER_SPEAKER_NOTE_GS7 MICROPY_FLOAT_CONST(3322.44)
+#define MP_FLIPPER_SPEAKER_NOTE_A7 MICROPY_FLOAT_CONST(3520.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS7 MICROPY_FLOAT_CONST(3729.31)
+#define MP_FLIPPER_SPEAKER_NOTE_B7 MICROPY_FLOAT_CONST(3951.07)
+#define MP_FLIPPER_SPEAKER_NOTE_C8 MICROPY_FLOAT_CONST(4186.01)
+#define MP_FLIPPER_SPEAKER_NOTE_CS8 MICROPY_FLOAT_CONST(4434.92)
+#define MP_FLIPPER_SPEAKER_NOTE_D8 MICROPY_FLOAT_CONST(4698.64)
+#define MP_FLIPPER_SPEAKER_NOTE_DS8 MICROPY_FLOAT_CONST(4978.03)
+#define MP_FLIPPER_SPEAKER_NOTE_E8 MICROPY_FLOAT_CONST(5274.04)
+#define MP_FLIPPER_SPEAKER_NOTE_F8 MICROPY_FLOAT_CONST(5587.65)
+#define MP_FLIPPER_SPEAKER_NOTE_FS8 MICROPY_FLOAT_CONST(5919.91)
+#define MP_FLIPPER_SPEAKER_NOTE_G8 MICROPY_FLOAT_CONST(6271.93)
+#define MP_FLIPPER_SPEAKER_NOTE_GS8 MICROPY_FLOAT_CONST(6644.88)
+#define MP_FLIPPER_SPEAKER_NOTE_A8 MICROPY_FLOAT_CONST(7040.0)
+#define MP_FLIPPER_SPEAKER_NOTE_AS8 MICROPY_FLOAT_CONST(7458.62)
+#define MP_FLIPPER_SPEAKER_NOTE_B8 MICROPY_FLOAT_CONST(7902.13)
 
 bool mp_flipper_speaker_start(float frequency, float volume);
 bool mp_flipper_speaker_set_volume(float volume);