54 #ifndef CSL_Types_H // All CSL header files can be included only once.
55 #define CSL_Types_H // That's what these flags are for.
63 #ifdef WIN32 // M$_Windows
67 #if defined (__APPLE__) // Mac OSX
73 #define CSL_ENUMS // define this to use the various enumerations (which are problematic with SWIG)
82 #define CSL_mFrameRate 44100
85 #define CSL_mBlockSize 256
86 #define CSL_mMaxBufferFrames 256
87 #define CSL_mSndFileFrames 2000000
88 #define CSL_mMaxSndFileFrames 2000000
90 #define CSL_mBlockSize 2048
91 #define CSL_mMaxBufferFrames 8192
92 #define CSL_mSndFileFrames 20480000
93 #define CSL_mMaxSndFileFrames 64000000
99 #define DEFAULT_WTABLE_SIZE CGestalt::maxBufferFrames()
101 #define CSL_mVerbosity 3
102 #define CSL_mLoggingPeriod 10
104 #define CSL_LOG_PREFIX "-- "
105 // #define CSL_LOG_PREFIX "\nCSL: "
107 #define CSL_mOutPort 57123
108 #define CSL_mOSCPort 54321
110 #define CSL_WORD_LEN 32
111 #define CSL_DEF_LEN 128
112 #define CSL_NAME_LEN 256
113 #define CSL_LINE_LEN 512
114 #define CSL_STR_LEN 1024
116 #define SAMPS_TO_WRITE (44100 * 30)
117 #define OUT_SFILE_NAME "XX_csl.aiff"
118 //#define OUT_SFILE_NAME "CSLXX.aiff"
121 #define CSL_DATA_DIR "..\\..\\..\\CSL_Data\\"
122 #define CSL_INIT_FILE "..\\..\\..\\csl.ini"
124 #define CSL_DATA_DIR "~/Code/CSL/CSL_Data/"
125 #define CSL_INIT_FILE "~/.cslrc"
132 #define SoundFile JSoundFile // JUCE snd file class
135 #define SoundFile LSoundFile // libSndFile
138 #define SoundFile CASoundFile // CoreAudio
141 #define USE_SNDFILEBUFFER // add snd file buffer class
147 #define DEFAULT_MIDI_IN 0
148 #define DEFAULT_MIDI_OUT 0
152 #ifndef CSL_WINDOWS // works on Mac & Linux
153 #define USE_LOSC // liblo for OSC
158 #define Osc WavetableOscillator // default "Osc" -- or use Sine?
188 #define cx_r(val) val[0]
189 #define cx_i(val) val[1]
190 #define ComplexPtr SampleBuffer
220 typedef std::map <CSL_MAP_KEY, Port *>
PortMap;
225 typedef std::map <std::string, UnitGenerator *>
UGenMap;
227 typedef std::map <unsigned, UnitGenerator *>
UGenIMap;
259 #define CSL_OPERAND 4
260 #define CSL_OPERAND2 5
261 #define CSL_FREQUENCY 6
262 #define CSL_POSITION 7
263 #define CSL_POSITIONX 7
264 #define CSL_POSITIONY 8
265 #define CSL_POSITIONZ 9
266 #define CSL_FILTER_FREQUENCY 10
267 #define CSL_FILTER_AMOUNT 11
275 #ifndef csl_min // csl_min(a, b)
276 #define csl_min(a, b) (((a) < (b)) ? (a) : (b))
279 #ifndef csl_max // csl_max(a, b)
280 #define csl_max(a, b) (((a) > (b)) ? (a) : (b))
285 #define csl_between(a, b, c) (((a) >= (b)) && ((a) <= (c)))
289 #define csl_max_r(a) (((a) > 1.0f) ? (a) : (1.0f/a))
290 #define csl_min_r(a) (((a) < 1.0f) ? (a) : (1.0f/a))
292 #define csl_abs(a) (((a) >= 0) ? (a) : (-a))
296 #define csl_max_d(a, b) ((a > b) ? (a / b) : (b / a))
297 #define csl_min_d(a, b) ((a < b) ? (a / b) : (b / a))
301 #define csl_ratio_rem(val1, val2, remainder) \
302 remainder = csl_max_d(val1, val2); \
303 remainder -= (int) remainder; \
304 if (remainder > 0.5f) { \
305 remainder = csl_max_r(rem); \
318 #define CSL_PI 3.1415926535897933f
320 #define CSL_TWOPI 6.2831853071795865f
321 #define CSL_PIHALF 1.570796326795f
322 #define CSL_SQRT_TWO 1.414213562f
323 #define CSL_SPEED_OF_SOUND 330.0f
324 #define CSL_EXP_PER_DB 0.11512925464970228f
325 #define CSL_SAMPS_PER_METER 133.63636363636364f
326 #define CSL_DEGS_PER_RAD 57.295779513082321f
332 #ifdef CSL_WINDOWS // Microsoft is explicit
335 #define hypotf(av, bv) sqrtf((av * av) + (bv * bv))
337 #ifdef MSVS6 // ignore pragmas not understood by Microsoft Visual C++
338 #pragma warning(once:4068 4244 4305 4355)
339 #pragma warning(once:4290)
347 #endif // CSL_WINDOWS
351 #endif // _CSLTypes_H