1
/*********************************************/
2
/* Object Class, by Perry R. Cook, 1995-99 */
4
/* This is mostly here for compatibility */
5
/* with Objective C. We'll also stick */
6
/* global defines here, so everyone will */
8
/*********************************************/
10
#if !defined(__Object_h)
26
/* The OS type definitions are made in the Makefile */
28
#if defined(__OS_NeXT_) /* For NeXTStep - Black or White Hardware */
29
#define RANDLIMIT 2147483647
30
#elif defined(__OS_IRIX_) /* For SGI */
31
#define __STK_REALTIME_
32
#define RANDLIMIT 2147483647
33
#elif defined(__OS_Linux_) /* For Linux */
34
#define __STK_REALTIME_
35
#define __OSS_API_ /* Use OSS API */
36
// #define __MIDIATOR_ /* Use special MIDIator support */
37
// #define __ALSA_API_ /* Use ALSA API */
38
#define __LITTLE_ENDIAN__
39
#define RANDLIMIT 2147483647
40
#elif defined(__OS_Win_) /* For WindowsXX or NT */
41
#define __STK_REALTIME_
42
#define __LITTLE_ENDIAN__
43
#define RANDLIMIT 32767
47
Real-time audio input and output buffer size. If clicks
48
are occuring in the input or output sound stream, a
49
larger buffer size may help. Larger buffer sizes, however,
50
produce more latency between input and output.
52
#define RT_BUFFER_SIZE 256
55
The following definition is concatenated to the beginning
56
of all references to rawwave files in the various STK core
57
classes (ex. Clarinet.cpp). If you wish to move the
58
rawwaves directory to a different location in your file
59
system, you will need to set this path definition
60
appropriately. The current definition is a relative reference
61
that will work "out of the box" for the STK distribution.
63
#define RAWWAVE_PATH getenv("RAWWAVE_PATH")
66
#define SRATE (MY_FLOAT) 44100.0
68
/* Other SRATE derived defines */
69
#define SRATE_OVER_TWO (MY_FLOAT) (SRATE / 2)
70
#define ONE_OVER_SRATE (MY_FLOAT) (1 / SRATE)
71
#define TWO_PI_OVER_SRATE (MY_FLOAT) (2 * PI / SRATE)
73
/* Yer Basic Trigonometric constants */
75
#define PI (MY_FLOAT) 3.14159265359
77
#define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI)
78
#define ONE_OVER_TWO_PI (MY_FLOAT) (1.0 / PI)
79
#define SQRT_TWO 1.414213562
81
/* Useful random number generator values */
82
#define ONE_OVER_RANDLIMIT (1.0/RANDLIMIT)
83
#define RANDLIMIT_OVER_TWO (int)(RANDLIMIT/2)
85
/* FPU Underflow Limit
86
* The IEEE specification doesn't call for automatic
87
* zeroing of floating-point values when they reach
88
* their numerical limits. Instead, most processors
89
* switch to a much more computation-intensive mode
90
* when a FPU underflow occurs. We set a lower limit
91
* here for our own (not so efficient) checks. Here's
92
* a useful macro for limiting MY_FLOATs. At this time,
93
* no FPU underflow checks are being performed.
95
#define FPU_UFLOW_LIMIT 0.0000000001
96
#define LIMIT_MY_FLOAT(j) ((((j)<(MY_FLOAT)FPU_UFLOW_LIMIT)&&((j)>(MY_FLOAT)-FPU_UFLOW_LIMIT))?(MY_FLOAT)0.0:(j))
98
/* States for Envelopes, etc. */
104
/* Machine dependent stuff, possibly useful for optimization.
105
* For example, changing double to float here increases
106
* performance (speed) by a whopping 4-6% on 486-flavor machines.
107
* BUT!! a change from float to double here increases speed by
108
* 30% or so on SGI machines.
110
#define MY_FLOAT double
111
//#define MY_FLOAT float
113
/* MY_MULTI is just a pointer to MY_FLOAT. This type is used
114
* to pass multichannel data back and forth within STK.
116
typedef MY_FLOAT *MY_MULTI;
118
/* INT16 is just that ... a 16-bit signed integer. */
119
typedef signed short INT16;
121
/* INT32 is just that ... a 32-bit signed integer. */
128
/* Debugging define, causes massive printf's to come out.
129
* Also enables timing calculations in WaveOut class, other stuff.
130
* Uncomment to enable.
134
/* MIDI definitions */
135
#define NORM_7 (MY_FLOAT) 0.0078125 /* this is 1/128 */