102k views
0 votes
On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * r^n, where n is the distance (number of keys) from that key, and r is 2^(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Ex: If the input is 440 (the A key near the middle of a piano keyboard), the output is: 440.0 466.1637615180899 493.8833012561241 523.2511306011974 554.3652619537442 Note: Use one statement to compute r = 2^(1/12) using the RaiseToPower() function. Then use that r in subsequent statements that use the formula fn = f0 * r^n with n being 1, 2, 3, and finally 4.

User Engie
by
6.1k points

1 Answer

0 votes

Final answer:

To determine the frequencies of keys on a piano, the formula fn = f0 · rn is used, where f0 represents the initial frequency and r is the twelfth root of 2. The frequencies for the next four higher keys from an initial frequency can be calculated by stepping n from 1 to 4, yielding the frequency sequence for those keys.

Step-by-step explanation:

When calculating the frequencies of keys on a piano, one must use the formula fn = f0 · rn, where f0 is the basic frequency of a key, r is the twelfth root of 2 (r = 21/12), and n is the number of keys away from the initial key. For instance, given an initial frequency of 440 Hz, we can calculate the frequencies of the next four higher keys by incrementing n from 1 to 4. Using r from the given RaiseToPower function, the frequencies can be found as follows:

f1 = 440 Hz (original frequency)

f2 = 440 · r1 (frequency of the next key)

f3 = 440 · r2 (and so on...)

f4 = 440 · r3

f5 = 440 · r4

Applying these calculations, we would get a sequence of frequencies for the next four keys, which are 466.1637615180899 Hz, 493.8833012561241 Hz, 523.2511306011974 Hz, and 554.3652619537442 Hz, respectively. This pattern follows the equal temperament scale, where each semitone corresponds to a fixed frequency ratio.

User Aaron Dufall
by
6.2k points