My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tunes.h 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * lcd/extui/anycubic_chiron/Tunes.h
  25. *
  26. * Extensible_UI implementation for Anycubic Chiron
  27. * Written By Nick Wells, 2020 [https://github.com/SwiftNick]
  28. * (not affiliated with Anycubic, Ltd.)
  29. */
  30. /**************************************************************************
  31. * Notes definition from https://pages.mtu.edu/~suits/NoteFreqCalcs.html *
  32. * *
  33. * The format of a tune is: *
  34. * {<whole note time>,<note1>,<length1>, <note2>,<length2>, ... <END>} *
  35. * *
  36. * 1) The first value is the length of a whole note in milliseconds *
  37. * 2) Then a sequence of pitch and duration pairs *
  38. * 3) Finally the END marker so your tunes can be any length up to *
  39. * MAX_TUNE_LEN *
  40. *************************************************************************/
  41. #include <stdint.h>
  42. #define MAX_TUNE_LENGTH 128
  43. // Special notes!
  44. #define n_P 0 // silence or pause
  45. #define n_END 10000 // end of tune marker
  46. // Note duration divisors
  47. #define l_T1 1
  48. #define l_T2 2
  49. #define l_T3 3
  50. #define l_T4 4
  51. #define l_T8 8
  52. #define l_T16 16
  53. // Note Frequency
  54. #define n_C0 16
  55. #define n_CS0 17
  56. #define n_D0 18
  57. #define n_DS0 19
  58. #define n_E0 21
  59. #define n_F0 22
  60. #define n_FS0 23
  61. #define n_G0 25
  62. #define n_GS0 26
  63. #define n_A0 28
  64. #define n_AS0 29
  65. #define n_B0 31
  66. #define n_C1 33
  67. #define n_CS1 35
  68. #define n_D1 37
  69. #define n_DS1 39
  70. #define n_E1 41
  71. #define n_F1 44
  72. #define n_FS1 46
  73. #define n_G1 49
  74. #define n_GS1 52
  75. #define n_A1 55
  76. #define n_AS1 58
  77. #define n_B1 62
  78. #define n_C2 65
  79. #define n_CS2 69
  80. #define n_D2 73
  81. #define n_DS2 78
  82. #define n_E2 82
  83. #define n_F2 87
  84. #define n_FS2 93
  85. #define n_G2 98
  86. #define n_GS2 104
  87. #define n_A2 110
  88. #define n_AS2 117
  89. #define n_B2 123
  90. #define n_C3 131
  91. #define n_CS3 139
  92. #define n_D3 147
  93. #define n_DS3 156
  94. #define n_E3 165
  95. #define n_F3 175
  96. #define n_FS3 185
  97. #define n_G3 196
  98. #define n_GS3 208
  99. #define n_A3 220
  100. #define n_AS3 233
  101. #define n_B3 247
  102. #define n_C4 262
  103. #define n_CS4 277
  104. #define n_D4 294
  105. #define n_DS4 311
  106. #define n_E4 330
  107. #define n_F4 349
  108. #define n_FS4 370
  109. #define n_G4 392
  110. #define n_GS4 415
  111. #define n_A4 440
  112. #define n_AS4 466
  113. #define n_B4 494
  114. #define n_C5 523
  115. #define n_CS5 554
  116. #define n_D5 587
  117. #define n_DS5 622
  118. #define n_E5 659
  119. #define n_F5 698
  120. #define n_FS5 740
  121. #define n_G5 784
  122. #define n_GS5 831
  123. #define n_A5 880
  124. #define n_AS5 932
  125. #define n_B5 988
  126. #define n_C6 1047
  127. #define n_CS6 1109
  128. #define n_D6 1175
  129. #define n_DS6 1245
  130. #define n_E6 1319
  131. #define n_F6 1397
  132. #define n_FS6 1480
  133. #define n_G6 1568
  134. #define n_GS6 1661
  135. #define n_A6 1760
  136. #define n_AS6 1865
  137. #define n_B6 1976
  138. #define n_C7 2093
  139. #define n_CS7 2217
  140. #define n_D7 2349
  141. #define n_DS7 2489
  142. #define n_E7 2637
  143. #define n_F7 2794
  144. #define n_FS7 2960
  145. #define n_G7 3136
  146. #define n_GS7 3322
  147. #define n_A7 3520
  148. #define n_AS7 3729
  149. #define n_B7 3951
  150. #define n_C8 4186
  151. #define n_CS8 4435
  152. #define n_D8 4699
  153. #define n_DS8 4978
  154. #define n_E8 5274
  155. #define n_F8 5587
  156. #define n_FS8 5920
  157. #define n_G8 6272
  158. #define n_GS8 6645
  159. #define n_A8 7040
  160. #define n_AS8 7459
  161. #define n_B8 7902
  162. namespace Anycubic {
  163. void PlayTune(uint8_t beeperPin, const uint16_t *tune, uint8_t speed);
  164. // Only uncomment the tunes you are using to save memory
  165. // This will help you write tunes!
  166. // https://www.apronus.com/music/flashpiano.htm
  167. const uint16_t SOS[] = {
  168. 250,
  169. n_G6,l_T3, n_P,l_T3, n_G6,l_T3, n_P,l_T3, n_G6,l_T3, n_P,l_T1,
  170. n_G6,l_T1, n_P,l_T3, n_G6,l_T1, n_P,l_T3, n_G6,l_T1, n_P,l_T1,
  171. n_G6,l_T3, n_P,l_T3, n_G6,l_T3, n_P,l_T3, n_G6,l_T3, n_P,l_T1,
  172. n_END
  173. };
  174. const uint16_t BeepBeep[] = {
  175. 500,
  176. n_C7,l_T8, n_P,l_T16, n_C7,l_T8, n_P,l_T8,
  177. n_END
  178. };
  179. const uint16_t BeepBeepBeeep[] = {
  180. 1000,
  181. n_G7,l_T4, n_P,l_T16, n_G7,l_T4, n_P,l_T8, n_G7,l_T2,
  182. n_END
  183. };
  184. const uint16_t Anycubic_PowerOn[] = {
  185. 1000,
  186. n_F7,l_T8, n_P,l_T8, n_C7,l_T8, n_P,l_T8, n_D7,l_T8, n_P,l_T8,
  187. n_E7,l_T8, n_P,l_T8, n_D7,l_T4, n_P,l_T4, n_G7,l_T4, n_P,l_T4,
  188. n_A7,l_T2, n_P,l_T1,
  189. n_END
  190. };
  191. const uint16_t GB_PowerOn[] = {
  192. 500,
  193. n_C6,l_T4, n_P,l_T16, n_C7,l_T2, n_P,l_T8,
  194. n_END
  195. };
  196. const uint16_t Heater_Timedout[] = {
  197. 1000,
  198. n_C6,l_T1,
  199. n_END
  200. };
  201. const uint16_t FilamentOut[] = {
  202. 1000,
  203. n_AS7,l_T4, n_P,l_T16, n_FS7,l_T2,
  204. n_END
  205. };
  206. }