|
From: <be...@ga...> - 2003-09-15 12:57:29
|
Hi, I was just wondering if Christian, Josh or others could enlighten me how stereo stamples are stored in DLS2 / GIG files. Are they stored as a single interleaved stereo sample or as two separate mono samples where the first is mapped to the left output channel while the second to the right channel ? Treating stereo samples as two mono samples has the advantage that you can set different loop points, modulation etc stuff. Regarding the sample sizes: I've seen only GIG files with 16bit samples in in them so far. Is 24bit possible ? If yes, how are they stored ? 24-bit packed ? (which means 3 32 bit words store 4 24 bit samples). In order to read these 24bit samples from disk efficiently (in large chunks) probably we would need a temporary buffer because the streaming ringbuffers (which in case of 16bit samples are arrays of 16bit quantities (=short datatype)), cannot easily cope with 3-bytes long (24bit) quantities. Ok they can (the ringbuffer.h template class can handle any kind of datatype so just define sample_24bit_t as char[3]. But I guess in order to not incur into CPU read/write penalties because usually the x86 needs 32bit-aligned read/writes to be able to work with the maximum efficientcy, we whould just fit the 24bit samples into 32bit words. Or am I wrong about the read/write alignement issues ? thoughts ? Benno ------------------------------------------------- This mail sent through http://www.gardena.net |