How the note values are calculated...

For the equal temperament scale, the frequency of each note in the chromatic scale is related to the frequency of the notes next to it by a factor of the twelfth root of 2 (1.0594630944....). Using the frequency of the note A (A0 = 27.5 Hz, A1 = 55 Hz, A2 = 110 Hz, A3 = 220 Hz, etc.) as the reference for each octave, generate the 12 notes of the octave from C thru B in the array...


double ChromaticScale[12], A = freq. of A for desired octave;
for(int i = -9; i<= 2; i++)
{
    if(i == 0)
    {
       ChromaticScale[i+9] = A;
       continue;
    }
    ChromaticScale[i+9] = (A * pow(2, (double) i / 12.0);
}