Created
July 9, 2010 10:28
-
-
Save atzkey/469328 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* Routine that generates frequencies for all 128 MIDI notes */ | |
#include <stdio.h> | |
#include <math.h> | |
int main() | |
{ | |
float midi[127]; | |
int a = 440; // a is 440 hz... | |
int x; | |
for (x = 0; x < 128; ++x) { | |
midi[x] = (a / 32.0) * pow(2, ((x - 9.0) / 12.0)); | |
printf("%f\n", midi[x]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment