--- linuxsampler/trunk/src/engines/sfz/sfz.h 2011/02/21 17:34:36 2167 +++ linuxsampler/trunk/src/engines/sfz/sfz.h 2011/07/28 18:24:12 2222 @@ -51,7 +51,9 @@ class Sample : public LinuxSampler::SampleFileBase { public: - Sample(String File, bool DontClose = false) : LinuxSampler::SampleFileBase(File, DontClose) { } + Sample(String File, bool DontClose = false, uint offset = 0): LinuxSampler::SampleFileBase(File, DontClose) { + Offset = offset; + } virtual ~Sample() { } }; @@ -70,7 +72,7 @@ class SampleManager : public LinuxSampler::SampleManager { public: - Sample* FindSample(std::string samplePath); + Sample* FindSample(std::string samplePath, int offset); protected: virtual void OnSampleInUse(Sample* pSample) { @@ -238,6 +240,20 @@ EG(); }; + class LFO + { + public: + float freq; // 0 to 20 Hz + uint wave; // 0 to 4294967296 + float delay; // 0 to 100 seconds + float volume; // -144 to 6 dB + int pitch; // -9600 to 9600 cents + int cutoff; // -9600 to 9600 cents + float resonance; // 0 to 40 dB + float pan; // -100 to 100 % + LFO(); + }; + // Fixed size array with copy-on-write semantics template class Array @@ -367,6 +383,8 @@ filter_t fil_type; filter_t fil2_type; optional cutoff; optional cutoff2; Array cutoff_oncc; Array cutoff2_oncc; + int cutoff_cc; // TODO: this is just a temporary fix to avoid + // looping through the cutoff_oncc array Array cutoff_smoothcc; Array cutoff2_smoothcc; Array cutoff_stepcc; Array cutoff2_stepcc; Array cutoff_curvecc; Array cutoff2_curvecc; @@ -394,8 +412,12 @@ //Deprecated (from version 1) float ampeg_delay, ampeg_start, ampeg_attack, ampeg_hold, ampeg_decay, ampeg_sustain, ampeg_release; + float ampeg_vel2delay, ampeg_vel2attack, ampeg_vel2hold, ampeg_vel2decay, ampeg_vel2sustain, ampeg_vel2release; float fileg_delay, fileg_start, fileg_attack, fileg_hold, fileg_decay, fileg_sustain, fileg_release; + float fileg_vel2delay, fileg_vel2attack, fileg_vel2hold, fileg_vel2decay, fileg_vel2sustain, fileg_vel2release; float pitcheg_delay, pitcheg_start, pitcheg_attack, pitcheg_hold, pitcheg_decay, pitcheg_sustain, pitcheg_release; + float pitcheg_vel2delay, pitcheg_vel2attack, pitcheg_vel2hold, pitcheg_vel2decay, pitcheg_vel2sustain, pitcheg_vel2release; + int fileg_depth, pitcheg_depth; float amplfo_delay, amplfo_fade, amplfo_freq, amplfo_depth; float fillfo_delay, fillfo_fade, fillfo_freq, fillfo_depth; float pitchlfo_delay, pitchlfo_fade, pitchlfo_freq; @@ -403,6 +425,9 @@ // envelope generators LinuxSampler::ArrayList eg; + + // low frequency oscillators + LinuxSampler::ArrayList lfos; }; class Query { @@ -544,6 +569,7 @@ int parseKey(const std::string& value); EG& eg(int x); EGNode& egnode(int x, int y); + LFO& lfo(int x); std::string currentDir; /// Pointer to the Instrument belonging to this file