We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d07fc2 commit cdb70b0Copy full SHA for cdb70b0
sixtube_lm/sixtube_lm.ino
@@ -780,12 +780,10 @@ void switchAlarm(char dir){
780
781
word getHz(byte note){
782
//Given a piano key note, return frequency
783
- //TODO (note-basenote)/12 resolves to a float...
784
- return 440*(2^((note-49)/12));
785
- //37 = 220 A3
786
- //49 = 440 A4
787
- //56 = 659.2 E5
788
- //61 = 880 A5
+ char relnote = note-49; //signed, relative to concert A
+ float reloct = relnote/12.0; //signed
+ word mult = 440*pow(2,reloct);
+ return mult;
789
}
790
//Sometimes we activate the beeper directly (e.g. pips) but most of the time we make a bell tone TODO
791
// char curBellToneLevel; //support negative just in case
0 commit comments