You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
900B

  1. /**********************************************/
  2. /** Utility to make various functions **/
  3. /** like exponential and log gain curves. **/
  4. /** Specifically for direct MIDI parameter **/
  5. /** conversions. **/
  6. /** Included here: **/
  7. /** A440 Referenced Equal Tempered Pitches **/
  8. /** as a function of MIDI note number. **/
  9. /** **/
  10. /**********************************************/
  11. #include <math.h>
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. void main()
  15. {
  16. int i,j;
  17. double temp;
  18. double data[128];
  19. /********* Pitch as fn. of MIDI Note **********/
  20. printf("double __MIDI_To_Pitch[128] = {");
  21. for (i=0;i<128;i++) {
  22. if (i%8 == 0) printf("\n");
  23. temp = 220.0 * pow(2.0,((double) i - 57) / 12.0);
  24. printf("%.2lf,",temp);
  25. }
  26. printf("};\n");
  27. exit(1);
  28. }