I want to generate sound for integers like tones for integers 1 to 10 and then send that to sound card. For example a 440 Hz tone for 1 500 Hz to 2 600 Hz for 3 and so on... Frequency is not the matter. The problem is generation of tone for many integers and then saving these tones into a .wave file and then playing that wave file.
Asked
Active
Viewed 327 times
-2
-
That sounds like a great goal. [So, what have you tried](http://mattgemmell.com/2008/12/08/what-have-you-tried/)? – Scott Chamberlain Mar 18 '13 at 20:19
-
i m just a beginner dont know much regarding that – user2178661 Mar 18 '13 at 20:21
-
2@user2178661 Then it seems like this is a good learning opportunity for you. If you just have other people do your work for you then you won't learn, and you'll be a beginner for the rest of your life. If you spend time solving your own problems you can become an expert yourself. – Servy Mar 18 '13 at 20:25
1 Answers
0
The easiest way to do this would be to set the frequency = the existing music standard.
var a = Math.Pow(2.0, 1.0/12.0);
var b = // Your Integer Here;
var f = 440 * Math.Pow(a, b);
That will give you the frequency of the chromatic scale. If you want a major scale, you can use b = 0, 2, 4, 5, 7, 9, 11, or 12
Link to the formula for musical notes: http://www.phy.mtu.edu/~suits/NoteFreqCalcs.html

EtherDragon
- 2,679
- 1
- 18
- 24