|
|
| Everything HP200LX: Knowledge, Products, Service |
|
Generate tone frequenciesFrom Dave Goodman CompuServe ID: [72330,130] This equation allows programmers and others to determine the frequency for a musical note. For instance, you can enter middle A and it will tell you that its 440 Hz. The equation also gives an example of the use of the if(S(variable)) function. {Music|!Tone Frequencies ! !Enter the octave, then press ! !function key for the note ! !Example: 4, F2 (octave), F8 (A) ! !and you will see A4 = 440 hz ! Octave 0 + if(S(C), 2093.00 / 2^(7-Octave) - C, if(S(D), 2349.32 / 2^(7-Octave) - D, if(S(E), 2637.02 / 2^(7-Octave) - E, if(S(F), 2793.83 / 2^(7-Octave) - F, if(S(G), 3135.96 / 2^(7-Octave) - G, if(S(A), 3520.00 / 2^(7-Octave) - A, if(S(B), 3951.07 / 2^(7-Octave) - B, if(S(CS),2217.46 / 2^(7-Octave) -CS, if(S(DS),2489.02 / 2^(7-Octave) -DS, if(S(FS),2959.96 / 2^(7-Octave) -FS, if(S(GS),3322.44 / 2^(7-Octave) -GS, if(S(AS),3729.31 / 2^(7-Octave) -AS, 0)))))))))))) } A shortcut for keying in the above equation is to enter the line: if(S(C), 2093.00 / 2^(7-Octave) - C Press (ENTER), then highlight the line with (SHIFT)-(<DOWN-ARROW>). Copy the line to the clipboard, using [CTRL]-[C] and then paste it 11 times, using the keystrokes [CTRL]-[V]. Make sure you're in over-write mode and type in the correct frequency number letter for each note and 12 parentheses after the final 0.
|
|
Copyright © 2005 Thaddeus Computing Inc
<