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.

56 lines
1.4KB

  1. /**********************************************/
  2. /** Utility to make various functions **/
  3. /** like exponential and log gain curves. **/
  4. /** **/
  5. /** Included here: **/
  6. /** Yamaha TX81Z curves for master gain, **/
  7. /** Envelope Rates (in normalized units), **/
  8. /** envelope sustain level, and more.... **/
  9. /**********************************************/
  10. #include <math.h>
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. void main()
  14. {
  15. int i,j;
  16. double temp;
  17. double data[128];
  18. /*************** TX81Z Master Gain *************/
  19. for (i=0;i<100;i++) {
  20. data[i] = pow(2.0,-(99-i)/10.0);
  21. }
  22. data[0] = 0.0;
  23. printf("double __FM4Op_gains[99] = {");
  24. for (i=0;i<100;i++) {
  25. if (i%8 == 0) printf("\n");
  26. printf("%lf,",data[i]);
  27. }
  28. printf("};\n");
  29. /*************** TX81Z Sustain Level ***********/
  30. for (i=0;i<16;i++) {
  31. data[i] = pow(2.0,-(15-i)/2.0);
  32. }
  33. data[0] = 0.0;
  34. printf("double __FM4Op_susLevels[16] = {");
  35. for (i=0;i<16;i++) {
  36. if (i%8 == 0) printf("\n");
  37. printf("%lf,",data[i]);
  38. }
  39. printf("};\n");
  40. /****************** Attack Rate ***************/
  41. for (i=0;i<32;i++) {
  42. data[i] = 6.0 * pow(5.7,-(i-1)/5.0);
  43. }
  44. printf("double __FM4Op_attTimes[16] = {");
  45. for (i=0;i<32;i++) {
  46. if (i%8 == 0) printf("\n");
  47. printf("%lf,",data[i]);
  48. }
  49. printf("};\n");
  50. exit(1);
  51. }