CSL_Types.h File Reference

#include <vector>
#include <map>
#include <string>

Go to the source code of this file.


Classes

struct  csl::testStruct

Namespaces

namespace  csl
 < we use the STL vector, map, and string classes

Defines

#define CSL_Types_H
#define CSL_ENUMS
#define DO_TIMING
#define CSL_mFrameRate   44100
 default sample rate (tested up to 96000)
#define CSL_mBlockSize   256
 normal hosts
#define CSL_mMaxBufferFrames   8192
 max block size (set large for zooming scopes)
#define CSL_mMaxSndFileFrames   128000000
 max file cache size = 128 MB (set to a large value)
#define DEFAULT_WTABLE_SIZE   CGestalt::maxBufferFrames()
 selected hardware interface at startup time
#define CSL_mVerbosity   3
 very verbose logging
#define CSL_mLoggingPeriod   10
 log CPU usage every N sec
#define CSL_LOG_PREFIX   ":: "
 prefix for log msgs (may be empty)
#define CSL_mOutPort   57123
 RFS output port.
#define CSL_mOSCPort   54321
 OSC input port.
#define CSL_NAME_LEN   256
 default string length
#define CSL_LINE_LEN   512
 default line length
#define CSL_DATA_DIR   "~/Code/CSL/CSL_Data/"
 folder where the CSL data can be found
#define SAMPS_TO_WRITE   (4096 * 10 * 10)
 record about 10 seconds by default
#define OUT_SFILE_NAME   "XX_csl.aiff"
 csl output file name temlpate
#define Osc   WavetableOscillator
#define cx_r(val)   val[0]
#define cx_i(val)   val[1]
#define ComplexPtr   SampleBuffer
 shorthand
#define CSL_SCALE   1
#define CSL_OFFSET   2
#define CSL_INPUT   3
#define CSL_OPERAND   4
#define CSL_OPERAND2   5
#define CSL_FREQUENCY   6
#define CSL_POSITION   7
#define CSL_POSITIONX   7
#define CSL_POSITIONY   8
#define CSL_POSITIONZ   9
#define CSL_FILTER_FREQUENCY   10
#define CSL_FILTER_AMOUNT   11
#define CSL_RATE   12
#define csl_min(a, b)   (((a) < (b)) ? (a) : (b))
#define csl_max(a, b)   (((a) > (b)) ? (a) : (b))
#define csl_between(a, b, c)   (((a) >= (b)) && ((a) <= (c)))
#define csl_max_r(a)   (((a) > 1.0f) ? (a) : (1.0f/a))
#define csl_min_r(a)   (((a) < 1.0f) ? (a) : (1.0f/a))
#define csl_abs(a)   (((a) >= 0) ? (a) : (-a))
#define csl_max_d(a, b)   ((a > b) ? (a / b) : (b / a))
#define csl_min_d(a, b)   ((a < b) ? (a / b) : (b / a))
#define csl_ratio_rem(val1, val2, remainder)
#define TRUE   1
#define FALSE   0
#define CSL_PI   3.1415926535897932f
#define CSL_TWOPI   6.2831853071795865f
#define CSL_PIHALF   1.570796326795f
#define CSL_SQRT_TWO   1.414213562f
#define CSL_SPEED_OF_SOUND   330.0f
#define CSL_EXP_PER_DB   0.11512925464970228f
#define CSL_SAMPS_PER_METER   133.63636363636364f
#define CSL_DEGS_PER_RAD   57.295779513082321f

Typedefs

typedef float csl::sample
 < All of CSL takes place in the "csl" namespace
typedef float csl::Sample
 (could be changed to int)
typedef sample * csl::SampleBuffer
 1-channel buffer data type, vector of (sample)
typedef SampleBuffer * csl::SampleBufferVector
 Multi-channel buffer data type, vector of (SampleBuffer).
typedef SampleBuffer * csl::SampleBufferArray
 Multi-channel buffer data type.
typedef sample csl::SampleComplex [2]
 array-of-2 complex # type (like FFTW)
typedef SampleComplex * csl::SampleComplexVector
 complex vector
typedef SampleComplex * csl::SampleComplexPtr
 complex pointer
typedef std::vector< CPoint * > csl::PointVector
 Forward declaration.
typedef void * csl::VOIDFCNPTR (void *arg)
 the generic void fcn pointer
typedef unsigned csl::CSL_MAP_KEY
 Forward declaration to IO Device model.
typedef std::map< CSL_MAP_KEY,
Port * > 
csl::PortMap
typedef std::vector
< UnitGenerator * > 
csl::UGenVector
 UGenVector: unit generator pointers (used for outputs).
typedef std::map< std::string,
UnitGenerator * > 
csl::UGenMap
 UGenMap: a named map of unit generators (used for GUIs).
typedef std::vector< IODevice * > csl::IODeviceVector
 IOs hold onto device vectors.
typedef unsigned long csl::Timestamp
typedef signed long long csl::INT64
typedef unsigned long long csl::UINT64


Define Documentation

#define CSL_Types_H

CSL_Types.h -- the top-most include file for CSL 5.0 (September, 2009).

Central typedefs and platform-specific macros, also includes the model & observer classes. This is normally included via CSL_Core.h or CSL_Includes.h.

See the copyright notice and acknowledgment of authors in the file COPYRIGHT

CSL 4 Coding Conventions Naming Class, member, and method names are written in "camelCase" as in "UnitGenerator." Class names are capitalized, but members and methods are written lower-camel-case. Data members (instance variables) are written with initial "m" then camelCase as in "mOffset." Enumeration constants are written with initial "k" followed by embedded caps as in "kDone." Privacy In general data members are protected and have accessor functions where appropriate. The one exception is Buffer which is considered a record class and has public members.

Compile-time options (These are not set in this file so that different applications can share the source tree.)

SoundFile type: USE_JSND - use the JUCE-based sound file class (requires only JUCE) USE_LSND - use libSndFile-based sound file class (supports many file types) USE_CASND - use the CoreAudio version (runs on iPhone)

FFT implementation USE_FFTW - use FFTW 3 (faster but complicated to build) USE_FFTREAL - use FFTReal (smaller and simpler) CORE CSL Types sample(float), Sample, SampleBuffer, SampleBufferVector, SampleComplex, SampleComplexVector PortMap, UGenVector, UGenMap, IODeviceVector, Timestamp, VOIDFCNPTR

Constants CSL_PI, CSL_TWOPI, CSL_PIHALF, CSL_SQRT_TWO, CSL_SPEED_OF_SOUND, CSL_EXP_PER_DB, CSL_SAMPS_PER_METER, CSL_DEGS_PER_RAD

Many useful macros below

#define CSL_ENUMS

#define DO_TIMING

#define CSL_mFrameRate   44100

default sample rate (tested up to 96000)

#define CSL_mBlockSize   256

normal hosts

I/O block size (set to 64-2048 in typical usage)

#define CSL_mMaxBufferFrames   8192

max block size (set large for zooming scopes)

#define CSL_mMaxSndFileFrames   128000000

max file cache size = 128 MB (set to a large value)

#define DEFAULT_WTABLE_SIZE   CGestalt::maxBufferFrames()

selected hardware interface at startup time

Referenced by csl::WavetableOscillator::fillSine().

#define CSL_mVerbosity   3

very verbose logging

#define CSL_mLoggingPeriod   10

log CPU usage every N sec

#define CSL_LOG_PREFIX   ":: "

prefix for log msgs (may be empty)

Referenced by csl::vlogMsg().

#define CSL_mOutPort   57123

RFS output port.

#define CSL_mOSCPort   54321

OSC input port.

#define CSL_NAME_LEN   256

#define CSL_LINE_LEN   512

default line length

Referenced by csl::HRTFDatabase::loadFromDB().

#define CSL_DATA_DIR   "~/Code/CSL/CSL_Data/"

folder where the CSL data can be found

#define SAMPS_TO_WRITE   (4096 * 10 * 10)

record about 10 seconds by default

#define OUT_SFILE_NAME   "XX_csl.aiff"

csl output file name temlpate

#define Osc   WavetableOscillator

#define cx_r ( val   )     val[0]

#define cx_i ( val   )     val[1]

#define ComplexPtr   SampleBuffer

shorthand

Referenced by csl::BinauralPanner::nextBuffer().

#define CSL_SCALE   1

#define CSL_OFFSET   2

#define CSL_INPUT   3

#define CSL_OPERAND   4

#define CSL_OPERAND2   5

#define CSL_FREQUENCY   6

#define CSL_POSITION   7

#define CSL_POSITIONX   7

#define CSL_POSITIONY   8

#define CSL_POSITIONZ   9

#define CSL_FILTER_FREQUENCY   10

#define CSL_FILTER_AMOUNT   11

#define CSL_RATE   12

#define csl_min ( a,
 )     (((a) < (b)) ? (a) : (b))

#define csl_max ( a,
 )     (((a) > (b)) ? (a) : (b))

#define csl_between ( a,
b,
 )     (((a) >= (b)) && ((a) <= (c)))

#define csl_max_r (  )     (((a) > 1.0f) ? (a) : (1.0f/a))

#define csl_min_r (  )     (((a) < 1.0f) ? (a) : (1.0f/a))

#define csl_abs (  )     (((a) >= 0) ? (a) : (-a))

#define csl_max_d ( a,
 )     ((a > b) ? (a / b) : (b / a))

#define csl_min_d ( a,
 )     ((a < b) ? (a / b) : (b / a))

#define csl_ratio_rem ( val1,
val2,
remainder   ) 

Value:

remainder = csl_max_d(val1, val2);              \
    remainder -= (int) remainder;                   \
    if (remainder > 0.5f) {                         \
        remainder = csl_max_r(rem);                 \
        remainder -= 1.0f;                          \
    }

#define TRUE   1

#define FALSE   0

#define CSL_PI   3.1415926535897932f

#define CSL_TWOPI   6.2831853071795865f

#define CSL_PIHALF   1.570796326795f

Referenced by test_Binaural_vertAxial().

#define CSL_SQRT_TWO   1.414213562f

#define CSL_SPEED_OF_SOUND   330.0f

#define CSL_EXP_PER_DB   0.11512925464970228f

#define CSL_SAMPS_PER_METER   133.63636363636364f

#define CSL_DEGS_PER_RAD   57.295779513082321f


Generated on Thu Sep 17 23:14:16 2009 for CSL by  doxygen 1.5.8