From your code:
// Key of C ........C D E F G A B
uint16_t majorC [29] = {
274, 308, 346, 366, 411, 461, 518,
549, 616, 691, 732, 822, 923, 1036,
1097, 1232, 1383, 1465, 1644, 1845, 2071,
2195, 2463, 2765, 2930, 3288, 3691, 4143, 4389
};
uint16_t mapMajorC(uint16_t input) {
PROGMEM prog_uint8_t value = (1023-input) / (1024/29);
return (majorC[value]);
}
You have the PROGMEM in completely the wrong place. What you need is something like this:
// Key of C ........C D E F G A B
PROGMEM prog_uint16_t majorC [29] = {
274, 308, 346, 366, 411, 461, 518,
549, 616, 691, 732, 822, 923, 1036,
1097, 1232, 1383, 1465, 1644, 1845, 2071,
2195, 2463, 2765, 2930, 3288, 3691, 4143, 4389
};
uint16_t mapMajorC(uint16_t input) {
uint16_t value = (1023-input) / (1024/29);
return pgm_read_word_near(&majorC[value]);
}
However, if you are using the equal tempered scale, why not have just one table giving the frequency for each note, then play scales by moving up/down the required number of semitones from the starting note?