Sound Physics: Generating Tones

  • Thread starter Thread starter Ciemnl
  • Start date Start date
  • Tags Tags
    Physics Sound
AI Thread Summary
To generate the frequency of musical notes programmatically, the formula f(n)=440 * 2^{(n-n_0)/12} can be used, where A4 is set at 440Hz and n represents the note's assigned number. The discussion highlights the equal temperament tuning system, which balances consonance and dissonance across the chromatic scale. It also mentions the concept of natural scales, which provide optimal frequencies for specific keys but require retuning for each key change. The natural A scale aligns harmonics well, while the natural C scale serves a similar purpose for music in C. Ultimately, equal temperament offers a practical solution for most musicians, minimizing the need for frequent retuning.
Ciemnl
Messages
3
Reaction score
0
Does anyone know how to generate the frequency in hertz of a note(middle C, F# ,G etc.) programatically assuming that middle A is 440Hz? Idealy you type in the note you wish to find the frequency of and it returns the frequency of it.

Thankyou!
 
Physics news on Phys.org
The notes are separated by a ratio of 2^{\frac{1}{12}}. To get the frequency of any note if we know that A4=440hz, you have to use this formula:

f(n)=440 \cdot 2^{\frac{n-n_0}{12}}.

Where you need to assign a number 'n' to each note, n_0 being the number of the note A. To simplify the formula, you can choose n_0 to be 0.

Eg.: ..., n(G3#)=-1, n(A4)=0, n(A4#)=1, etc...
 
Thanks, I am guessing the dot after 440 means multiply
 
You may (or may not) find it interesting to investigate other tuning systems. The one GPPaille described is called "equal temperament".
 
The RELATIONSHIPS between the tones is interesting - consonance versus dissonance.
Go through the prime numbers:
1) 440*1=440. :- closest relation is itself
2) 440*2=880. :- A, same note one octave higher - very consonant
440/2=220. :- A, same note one octave lower - " "
3) 440*3=1320 :- E, 19 steps up - consonant
440*3/2=660 :- E, 7 steps up - "
440/3=146.67 :- D, 19 steps down - consonant
440/3*2=293.333 :- D, 7 steps down - "
5) 440*5=2200 :- Dflat, 28 steps higher
440*5/4=550 :- Dflat , 4 steps higher
there is more
. . . . and so on and so forth - tending towards dissonance as you progress through the primes

The chromatic scale uses the twelvth root of 2 ( 1.059463094) as has been already expressed in the above posts, and it is interesting to see the difference
Natural E, 7 steps up = 660
Chromatic E, 7 steps up = 659.25
 
In case anyone is interested, the "natural A scale" described by LeonStanley in post #5 is the optimum set of frequencies for playing music written in the key of A. All of the notes' harmonics line up with each other perfectly and it sounds nice.

However for music written in the key of C, the optimum scale would be the "natural C scale" based in a similar way on multiples of the frequency of C. And so on for all the other keys. The disadvantage of using the natural scales is that you have to retune your instrument every time you play music in a different key. The "equitempered scale" described by GPPaille in post #2 is a compromise that is sufficiently close to all of the natural scales that most people who aren't expert musicians arguably wouldn't notice the difference.
 
Hello everyone, Consider the problem in which a car is told to travel at 30 km/h for L kilometers and then at 60 km/h for another L kilometers. Next, you are asked to determine the average speed. My question is: although we know that the average speed in this case is the harmonic mean of the two speeds, is it also possible to state that the average speed over this 2L-kilometer stretch can be obtained as a weighted average of the two speeds? Best regards, DaTario
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Back
Top