47 #ifndef CSL_BINAURALDB_H
48 #define CSL_BINAURALDB_H
65 #define HRTF_BLOCK_SIZE 512
66 #define HRIR_SIZE 1024
68 #define HRTF_BLOCK_SIZE 256
69 #define HRIR_SIZE 1024
72 #define FLIST_NAME "files.txt"
73 #define DEFAULT_HRTF_FOLDER "IRCAM_HRTF/"
76 #define HRTF_RESOURCE "1047"
78 #define HRTF_RESOURCE "IRC_1047_R"
89 #define cmac(in1, in2, out) \
90 out[0] += in1[0] * in2[0] - in1[1] * in2[1]; \
91 out[1] += in1[0] * in2[1] + in1[1] * in2[0];
105 HRTF(
char * fname, FFT_Wrapper & fft);
134 static void Reload(
char * folder);
146 void dump(
bool verbose =
false);
SampleComplex * SampleComplexVector
complex vector
SampleComplexVector * mHrtfR
2 arrays of arrays of mNumFFTBlocks * complex[513]: the HRTF data in blocks of complex # for stereo ...
unsigned mWindowSize
FFT sizes (1024)
static HRTFDatabase * Database()
accessor for the singleton instance (lazy init)
void loadFromFolder(const char *folder)
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
unsigned numBlocks()
The length (in windows) of the impulse responses loaded.
unsigned hrtfLength()
The length (in samples) of the Transfer Function buffer.
unsigned hrirLength()
The length (in samples) of the impulse responses loaded.
CPoint mPosition
The Position at which the HRIR was recorded.
unsigned numHRTFs()
Total number of HRTFs loaded into the database.
static HRTFDatabase * mDatabase
The protected single instance of the HRTF Database.
unsigned mHRIRLength
The length of the Head Related Impulse Response (8192)
static void Reload(char *folder)
load the singleton from the given data folder
unsigned size()
returns the size on bytes of the receiver's storage
unsigned windowSize()
The size of the analysis window (in samples).
static void Destroy()
free the instance
HRTFDatabase: has a vector of HRTFs and can access them by position – hrtfAt(CPoint) – or by index ...
void loadFromDB(const char *dbName)
unsigned mNumFFTBlocks
of blocks (16)
HRTF: holds the data that corresponds to an HRTF for a single position. It has a list of complex buff...
void storeToDB(const char *filename, const char *same)
SampleComplexVector * mHrtfL
unsigned hrtfAt(CPoint srcPos)
answer the index of the HRTF nearest the given point
void dump(bool verbose=false)
Print all the HRTFs in the database.
HRTFVector mHRTFVector
vector of the HRTFs that constitute the database
HRTFDatabase(const char *folder)
constructor that loads from a folder (protected) load a set of HRTFs from a folder or a file list fil...
vector< HRTF * > HRTFVector
void loadFromFile(const char *filename)
static void convertDB(const char *listname)
bulk-convert DBs
HRTF()
HRTF constructor allocates memory for the HRTF data and then reads the HRIR file and performs the blo...
void dump()
Prints the position that corresponds to this HRTF.
unsigned size()
returns the size on bytes of the receiver's storage
Base class of CSL exceptions (written upper-case). Has a string message.