function noteToFreq(note) {
let a = 440; //frequency of A (coomon value is 440Hz)
return (a / 32) * (2 ** ((note - 9) / 12));
}
function noteToFreq($note) {
$a = 440; //frequency of A (coomon value is 440Hz)
return ($a / 32) * (2 ** (($note - 9) / 12));
}
def noteToFreq(note):
a = 440 #frequency of A (coomon value is 440Hz)
return (a / 32) * (2 ** ((note - 9) / 12))
#include <math.h> //<cmath> in case of c++
float noteToFreq(int note) {
float a = 440; //frequency of A (coomon value is 440Hz)
return (a / 32) * pow(2, ((note - 9) / 12.0));
}
Thanks!