C++ Sound

PC Speaker Notes
Note Frequencies (Hz)

Although most people use digitized sound, such as voc,wav,au,and midi files for sound now days, I thought it might be useful to some to put up the sound frequencies so you can play sound through your pc speaker if you wanted to.

These are the Frequencies you need to use to make the correct note, in a programming lanugage such as C/C++ you would use the following section of code to play a note...


sound(65);
delay(1000);
nosound();

This would play note C (see chart below) for 1 second.

Note \ Octave 0 1 2 3 4 5 6 7
C 16 33 65 131 262 523 1046 2093
C# 17 35 69 139 277 554 1109 2217
D 18 37 73 147 294 587 1175 2349
D# 19 39 78 155 311 622 1244 2489
E 21 41 82 165 330 659 1328 2637
F 22 44 87 175 349 698 1397 2794
F# 23 46 92 185 370 740 1480 2960
G 24 49 98 196 392 784 1568 3136
G# 26 52 104 208 415 831 1661 3322
A 27 55 110 220 440 880 1760 3520
A# 29 58 116 223 446 932 1865 3729
B 31 62 123 245 494 988 1975 3951
Antony Chesworth
To be exact though
Middle C263.181
C#275.000
D294.246
D#294.246
E328.977
F352.000
F#367.807
G393.548
G#411.221
A440.000
A#470.793
B491.935
C526.363
bellyngal

An octave works such that a one octave jump corresponds to doubling the Hz. So if middle A is 440 Hz the A above that is 880 Hz. There are 12 steps in an octave (since you include flats/sharps) so you can go one step above where you're at by taking the number * 2^(1/12) [where ^ is the power operator not the xor]

jmeinel