/[svn]/linuxsampler/trunk/src/engines/sfz/SfzSignalUnitRack.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/sfz/SfzSignalUnitRack.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2233 by iliev, Mon Aug 8 18:46:19 2011 UTC revision 2244 by iliev, Thu Aug 18 11:32:33 2011 UTC
# Line 32  Line 32 
32  #include "../common/SineLFO.h"  #include "../common/SineLFO.h"
33    
34  namespace LinuxSampler { namespace sfz {  namespace LinuxSampler { namespace sfz {
35      const int MaxUnitCount = 1000;      const int MaxUnitCount = 200;
36      const int maxEgCount = 100; // Maximum number of v2 envelope generators      const int maxEgCount = 30; // Maximum number of v2 envelope generators
37      const int maxLfoCount = 100; // Maximum number of v2 LFOs      const int maxLfoCount = 30; // Maximum number of v2 LFOs
38            
39      class Voice;      class Voice;
40      class SfzSignalUnitRack;      class SfzSignalUnitRack;
# Line 90  namespace LinuxSampler { namespace sfz { Line 90  namespace LinuxSampler { namespace sfz {
90            
91      class SmoothCCUnit: public CurveCCUnit {      class SmoothCCUnit: public CurveCCUnit {
92          protected:          protected:
93              Smoother Smoothers[128];              RTList<Smoother>* pSmoothers;
94          public:          public:
95              SmoothCCUnit(SfzSignalUnitRack* rack, Listener* l = NULL): CurveCCUnit(rack, l) { }              SmoothCCUnit(SfzSignalUnitRack* rack, Listener* l = NULL): CurveCCUnit(rack, l), pSmoothers(NULL) { }
96                virtual ~SmoothCCUnit();
97                            
98              virtual void AddSmoothCC(uint8_t Controller, float Influence, short int Curve, float Smooth);              virtual void AddSmoothCC(uint8_t Controller, float Influence, short int Curve, float Smooth);
99                virtual void RemoveAllCCs() { CurveCCUnit::RemoveAllCCs(); pSmoothers->clear(); }
100                virtual void InitCCList(Pool<CC>* pCCPool, Pool<Smoother>* pSmootherPool);
101                
102                void InitSmoothers(Pool<Smoother>* pSmootherPool);
103        };
104        
105        
106        class XFInCCUnit: public CCUnit {
107            public:
108                XFInCCUnit(SfzSignalUnitRack* rack, Listener* l = NULL): CCUnit(rack, l) { }
109                
110                virtual bool Active() { return !pCtrls->isEmpty(); }
111                virtual void Calculate();
112                virtual void SetCrossFadeCCs(::sfz::Array<int>& loCCs, ::sfz::Array<int>& hiCCs);
113        };
114        
115        
116        class XFOutCCUnit: public XFInCCUnit {
117            public:
118                XFOutCCUnit(SfzSignalUnitRack* rack, Listener* l = NULL): XFInCCUnit(rack, l) { }
119                
120                virtual void Calculate();
121      };      };
122            
123            
# Line 158  namespace LinuxSampler { namespace sfz { Line 181  namespace LinuxSampler { namespace sfz {
181          protected:          protected:
182              ::sfz::EG egInfo;              ::sfz::EG egInfo;
183          public:          public:
184              EGv2Unit(SfzSignalUnitRack* rack): EGUnit< ::LinuxSampler::sfz::EG>(rack) { }              CCUnit suAmpOnCC;
185                CCUnit suVolOnCC;
186                CCUnit suPitchOnCC;
187                CCUnit suCutoffOnCC;
188                CCUnit suResOnCC;
189                CurveCCUnit suPanOnCC;
190                
191                EGv2Unit(SfzSignalUnitRack* rack);
192              virtual void Trigger();              virtual void Trigger();
193      };      };
194            
# Line 246  namespace LinuxSampler { namespace sfz { Line 276  namespace LinuxSampler { namespace sfz {
276              virtual void  Trigger();              virtual void  Trigger();
277              virtual void  Increment();              virtual void  Increment();
278              virtual float GetLevel() { return Level; }              virtual float GetLevel() { return Level; }
279              virtual void  ValueChanged(CCSignalUnit* pUnit);              
280                // CCSignalUnit::Listener interface implementation
281                virtual void ValueChanged(CCSignalUnit* pUnit);
282      };      };
283            
284      class LFOv1Unit: public LFOUnit {      class LFOv1Unit: public LFOUnit {
# Line 309  namespace LinuxSampler { namespace sfz { Line 341  namespace LinuxSampler { namespace sfz {
341            
342            
343      class EndpointUnit: public EndpointSignalUnit {      class EndpointUnit: public EndpointSignalUnit {
344            private:
345                float xfCoeff; // crossfade coefficient
346                float pitchVeltrackRatio;
347                
348          public:          public:
349              Voice* pVoice;              Voice* pVoice;
350                XFInCCUnit   suXFInCC;
351                XFOutCCUnit  suXFOutCC;
352                SmoothCCUnit suPanOnCC;
353    
354              EndpointUnit(SfzSignalUnitRack* rack);              EndpointUnit(SfzSignalUnitRack* rack);
355    
# Line 330  namespace LinuxSampler { namespace sfz { Line 369  namespace LinuxSampler { namespace sfz {
369              virtual float CalculateResonance(float res) {              virtual float CalculateResonance(float res) {
370                  return GetResonance() + res;                  return GetResonance() + res;
371              }              }
372                
373                virtual float CalculateFilterCutoff(float cutoff);
374      };      };
375            
376            
# Line 356  namespace LinuxSampler { namespace sfz { Line 397  namespace LinuxSampler { namespace sfz {
397              // used for optimization - contains only the ones that are modulating pitch              // used for optimization - contains only the ones that are modulating pitch
398              FixedArray<EGv2Unit*> pitchEGs;              FixedArray<EGv2Unit*> pitchEGs;
399                            
400                // used for optimization - contains only the ones that are modulating filter cutoff
401                FixedArray<EGv2Unit*> filEGs;
402                
403                // used for optimization - contains only the ones that are modulating resonance
404                FixedArray<EGv2Unit*> resEGs;
405                
406                // used for optimization - contains only the ones that are modulating pitch
407                FixedArray<EGv2Unit*> panEGs;
408                
409                            
410              FixedArray<LFOv2Unit*> LFOs;              FixedArray<LFOv2Unit*> LFOs;
411                            
# Line 389  namespace LinuxSampler { namespace sfz { Line 439  namespace LinuxSampler { namespace sfz {
439              virtual void Trigger();              virtual void Trigger();
440              virtual void EnterFadeOutStage();              virtual void EnterFadeOutStage();
441                            
442                /** Called when the engine is set and the engine's pools are ready to use. */
443                void InitRTLists();
444                
445                /** Invoked when the voice gone inactive. */
446                void Reset();
447                
448              friend class EndpointUnit;              friend class EndpointUnit;
449      };      };
450  }} // namespace LinuxSampler::sfz  }} // namespace LinuxSampler::sfz

Legend:
Removed from v.2233  
changed lines
  Added in v.2244

  ViewVC Help
Powered by ViewVC