I have another conversion question. Given the number of the key on a standard piano keyboard counting from 1 as A to 88 as C, I need to find out witch octave and note it designates. For example, an input of 49 would output octave 4 and note A.
The octave is easy, it is simply the floor of the key number divided by twelve. But I can't figure out an elegant way to calculate the note.
I don't know wether this is the right place to ask this question, so please migrate if anyone has can think of a better place.