notes.h 801 B

12345678910111213141516171819202122
  1. #include "avr/pgmspace.h"
  2. #define MIDI_START 36 // here starts our table, lowest is C2
  3. #define MIDI_NOTES 73
  4. // converting midi notes into the desired frequwnz for the tone function
  5. // the frequenz was calculated with libreoffice calc with this fm = (440 Hz)* 2^((m−69)/12) and than rounded.
  6. const PROGMEM unsigned int midiNoteToFreq[MIDI_NOTES] =
  7. {
  8. 65, // C2
  9. 69, 73, 78, 82, 87, 92, 98, 104, 110, 117, 123,
  10. 131, // C3
  11. 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247,
  12. 262, //C4
  13. 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494,
  14. 523, //C5
  15. 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988,
  16. 1047, //C6
  17. 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1976,
  18. 2093, //C7
  19. 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 3520, 3729, 3951,
  20. 4186 //C8
  21. };