CSL_Types.h File Reference

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

Go to the source code of this file.

Namespaces

namespace  csl

Classes

struct  csl::testStruct

Defines

#define CSL_Types_H
#define CSL_ENUMS
#define CSL_mFrameRate   44100
 default sample rate (tested up to 96000)
#define CSL_mBlockSize   512
 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
#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_WORD_LEN   32
 default short string length
#define CSL_NAME_LEN   256
 default string length
#define CSL_LINE_LEN   512
 default line length
#define CSL_STR_LEN   1024
 default long string length
#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 CSL_DATA_DIR   "~/Code/CSL/CSL_Data/"
 folder where the CSL data can be found
#define CSL_INIT_FILE   "~/.cslrc"
 where to store the CSL init file
#define DO_TIMING
 Gather performance timing (not on Windows).
#define USE_JMIDI
#define USE_LOSC
#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.1415926535897933f
#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
 < short-hand for the base sample type
typedef float csl::Sample
 (could be changed to int) the same, written upper-case
typedef samplecsl::SampleBuffer
 1-channel buffer data type, vector of (sample)
typedef SampleBuffercsl::SampleBufferVector
 Multi-channel buffer data type, vector of (SampleBuffer).
typedef SampleBuffercsl::SampleBufferArray
 Multi-channel buffer data type.
typedef sample csl::SampleComplex [2]
 array-of-2 complex # type (like FFTW)
typedef SampleComplexcsl::SampleComplexVector
 complex vector
typedef SampleComplexcsl::SampleComplexPtr
 complex pointer
typedef std::vector< CPoint * > csl::PointVector
 Forward declaration A vector of points.
typedef void * csl::VOIDFCNPTR (void *arg)
 the generic void fcn pointer
typedef unsigned csl::CSL_MAP_KEY
 Forward declaration.
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 std::vector< Instrument * > csl::InstrumentVector
 Players hold onto Instrument vectors/maps.
typedef std::map< int, InstrumentVectorcsl::InstrumentLibrary
typedef std::map< std::string,
Instrument * > 
csl::InstrumentMap
typedef unsigned long csl::Timestamp


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 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." Compiler flags and defines are generally written all-upperr-case as in "USE_CASND." 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) USE_KISSFFT - use KISS FFT (smaller, untested)

Thread implementation USE_JTHREADS - use the JUCE thread classes (otherwise use pthreads)

MIDI API USE_JMIDI - use JUCE's MIDI I/O

OSC API USE_LOSC - use LibLo for OSC (assumes liblio 0.26 is installed) USR_KOSC - use OSCKit for OSC (not implemented yet)

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 CSL_mFrameRate   44100
 

default sample rate (tested up to 96000)

#define CSL_mBlockSize   512
 

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

#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_WORD_LEN   32
 

default short string length

#define CSL_NAME_LEN   256
 

default string length

#define CSL_LINE_LEN   512
 

default line length

#define CSL_STR_LEN   1024
 

default long string length

#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 CSL_DATA_DIR   "~/Code/CSL/CSL_Data/"
 

folder where the CSL data can be found

#define CSL_INIT_FILE   "~/.cslrc"
 

where to store the CSL init file

#define DO_TIMING
 

Gather performance timing (not on Windows).

#define USE_JMIDI
 

#define USE_LOSC
 

#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,
 )     (((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.1415926535897933f
 

#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
 


Generated on Sat Oct 17 14:12:32 2009 for CSL by  doxygen 1.4.5-20051010