Last active
July 22, 2018 15:10
-
-
Save cleverfox/33d99ee0443d59603424 to your computer and use it in GitHub Desktop.
Notes pitch freq. calclulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @nn=("A ","Bb","B ","C ","C#", "D ","Eb","E ","F ","F#","G ","G#"); | |
for(-48..39){ | |
printf("%s %f\n",note($_),440*2**($_/12)); | |
}; | |
sub note { | |
my $n=shift; | |
return sprintf("%s%2d",$nn[($n%12)],int(($n+(12*4)+9)/12)-3); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment