home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / NOTATION / SILENCE / OBJECT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-08  |  2.3 KB  |  97 lines

  1. /*******************************************/
  2. /*  Object Class, by Perry R. Cook, 1995-96*/ 
  3. /*  This is mostly here for compatibility  */
  4. /*  with Objective C.  We'll also stick    */
  5. /*  global defines here, so everyone will  */
  6. /*  see them.                              */
  7. /*******************************************/
  8.  
  9. #if !defined(__Object_h)
  10. #define __Object_h
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <math.h>
  16.  
  17. class Object
  18. {
  19.   public:
  20.      int MIDI_control1;
  21.      int MIDI_control2;
  22.      int MIDI_control3;
  23.      int MIDI_mod_wheel;
  24.      int MIDI_after_touch;     
  25.   protected:
  26.     Object();
  27.     ~Object();
  28. };
  29.  
  30. /*   Only use one of __NeXT_  __WIN95_REALTIME_  */
  31. /*   __SGI_REALTIME_     */
  32.  
  33. /*  #define __SGI_REALTIME_     */
  34. /*   #define __NeXT_             */
  35. #define __WIN95_REALTIME_
  36.  
  37.  
  38. /* SRATE here is 44100  */
  39. /*   #define SRATE 44100.0
  40.      #define SRATE_OVER_TWO 22050.0
  41.      #define ONE_OVER_SRATE 0.00002267573696
  42. */
  43.  
  44. /* SRATE here is 22050, others are derived accordingly   */
  45.    #define SRATE 22050.0
  46.    #define SRATE_OVER_TWO 11025.0
  47.    #define ONE_OVER_SRATE 0.00004535147392
  48.  
  49.  
  50. /* SRATE here is 32000, others are derived accordingly   */
  51. /*   #define SRATE 32000.0
  52.    #define SRATE_OVER_TWO 16000.0
  53.    #define ONE_OVER_SRATE 0.00003125
  54. */
  55.  
  56. /* SRATE here is 8k   */
  57. /*   #define SRATE 8000.0
  58.    #define SRATE_OVER_TWO 4000
  59.    #define ONE_OVER_SRATE 0.00012500000000
  60. */
  61.  
  62. /* Yer Basic Trigonometric constants  */
  63. #define PI 3.14159265359
  64. #define TWO_PI 6.28318530718
  65. #define ONE_OVER_TWO_PI 0.15915494309
  66.  
  67. /* States for Envelopes, etc.         */
  68.  
  69. #define ATTACK 0
  70. #define DECAY 1
  71. #define SUSTAIN 2
  72. #define RELEASE 3
  73.  
  74. /* Machine dependent stuff, possibly useful for optimization        */
  75. /*    for example, changing double to float here increases          */
  76. /*    performance (speed) by a whopping 4-6% on 486-flavor machines */
  77. /*    BUT!! a change from float to double here increases speed by   */
  78. /*    30% or so on SGI machines                        */
  79. /*  #define MY_FLOAT      float  */
  80. /*  #define MY_FLOAT_SIZE 4      */
  81.  
  82. #define MY_FLOAT      double
  83. #define MY_FLOAT_SIZE 8
  84.  
  85. /* Debugging define, causes massive printf's to come out.           */
  86. /* Also enables timing calculations in WaveOut class, other stuff.  */
  87. /* #define _debug_ 1 */
  88.  
  89. #include <stdio.h>
  90.  
  91. /* MIDI definitions  */
  92. #define NORM_7 0.0078125
  93.         /* this is 1/128 */
  94.         
  95.         
  96. #endif
  97.