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

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

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

revision 2220 by iliev, Thu Jul 28 15:47:51 2011 UTC revision 2230 by iliev, Fri Aug 5 17:59:10 2011 UTC
# Line 83  namespace sfz Line 83  namespace sfz
83              pSample->Close();              pSample->Close();
84          }          }
85      };      };
86        
87        class CC {
88            public:
89                uint8_t   Controller;  ///< MIDI controller number.
90                short int Curve;
91                float     Influence;   ///< Controller Value.
92                
93                CC(uint8_t Controller = 0, float Influence = 0.0f, short int Curve = -1) {
94                    this->Controller = Controller;
95                    this->Influence  = Influence;
96                    this->Curve      = Curve;
97                }
98                        
99                CC(const CC& cc) { Copy(cc); }
100                void operator=(const CC& cc) { Copy(cc); }
101                        
102                void Copy(const CC& cc) {
103                    Controller = cc.Controller;
104                    Influence  = cc.Influence;
105                    Curve      = cc.Curve;
106                }
107        };
108    
109      /////////////////////////////////////////////////////////////      /////////////////////////////////////////////////////////////
110      // class Exception      // class Exception
# Line 225  namespace sfz Line 247  namespace sfz
247          float level;          float level;
248          float shape;          float shape;
249          float curve;          float curve;
250            LinuxSampler::ArrayList<CC> time_oncc;
251            LinuxSampler::ArrayList<CC> level_oncc;
252            
253          EGNode();          EGNode();
254            EGNode(const EGNode& egNode) { Copy(egNode); }
255            void operator=(const EGNode& egNode) { Copy(egNode); }
256            void Copy(const EGNode& egNode);
257      };      };
258    
259      class EG      class EG
# Line 238  namespace sfz Line 266  namespace sfz
266          float amplitude;          float amplitude;
267          float cutoff;          float cutoff;
268          EG();          EG();
269            EG(const EG& eg) { Copy(eg); }
270            void operator=(const EG& eg) { Copy(eg); }
271            void Copy(const EG& eg);
272      };      };
273    
274      class LFO      class LFO
275      {      {
276      public:      public:
277            float delay; // 0 to 100 seconds
278          float freq; // 0 to 20 Hz          float freq; // 0 to 20 Hz
279            float fade; // 0 to 100 seconds
280            float phase; // 0 to 360 degrees
281          uint  wave; // 0 to 4294967296          uint  wave; // 0 to 4294967296
282          float delay; // 0 to 100 seconds          float volume; // -144 to 6 dB
283          int   pitch; // -9600 to 9600 cents          int   pitch; // -9600 to 9600 cents
284          int   cutoff; // -9600 to 9600 cents          int   cutoff; // -9600 to 9600 cents
285          float resonance; // 0 to 40 dB          float resonance; // 0 to 40 dB
286          float pan; // -100 to 100 %          float pan; // -100 to 100 %
287            
288            LinuxSampler::ArrayList<CC> freq_oncc; // 0 to 20 Hz
289            LinuxSampler::ArrayList<CC> fade_oncc; // 0 to 100 seconds
290            LinuxSampler::ArrayList<CC> phase_oncc; // 0 to 360 degrees
291            LinuxSampler::ArrayList<CC> pitch_oncc;
292            
293          LFO();          LFO();
294            LFO(const LFO& lfo) { Copy(lfo); }
295            void operator=(const LFO& lfo) { Copy(lfo); }
296            void Copy(const LFO& lfo);
297      };      };
298    
299      // Fixed size array with copy-on-write semantics      // Fixed size array with copy-on-write semantics
# Line 412  namespace sfz Line 455  namespace sfz
455          //Deprecated (from version 1)          //Deprecated (from version 1)
456          float ampeg_delay, ampeg_start, ampeg_attack, ampeg_hold, ampeg_decay, ampeg_sustain, ampeg_release;          float ampeg_delay, ampeg_start, ampeg_attack, ampeg_hold, ampeg_decay, ampeg_sustain, ampeg_release;
457          float ampeg_vel2delay, ampeg_vel2attack, ampeg_vel2hold, ampeg_vel2decay, ampeg_vel2sustain, ampeg_vel2release;          float ampeg_vel2delay, ampeg_vel2attack, ampeg_vel2hold, ampeg_vel2decay, ampeg_vel2sustain, ampeg_vel2release;
458            LinuxSampler::ArrayList<CC> ampeg_delaycc, ampeg_startcc, ampeg_attackcc, ampeg_holdcc;
459            LinuxSampler::ArrayList<CC> ampeg_decaycc, ampeg_sustaincc, ampeg_releasecc;
460          float fileg_delay, fileg_start, fileg_attack, fileg_hold, fileg_decay, fileg_sustain, fileg_release;          float fileg_delay, fileg_start, fileg_attack, fileg_hold, fileg_decay, fileg_sustain, fileg_release;
461            float fileg_vel2delay, fileg_vel2attack, fileg_vel2hold, fileg_vel2decay, fileg_vel2sustain, fileg_vel2release;
462          float pitcheg_delay, pitcheg_start, pitcheg_attack, pitcheg_hold, pitcheg_decay, pitcheg_sustain, pitcheg_release;          float pitcheg_delay, pitcheg_start, pitcheg_attack, pitcheg_hold, pitcheg_decay, pitcheg_sustain, pitcheg_release;
463          float pitcheg_vel2delay, pitcheg_vel2attack, pitcheg_vel2hold, pitcheg_vel2decay, pitcheg_vel2sustain, pitcheg_vel2release;          float pitcheg_vel2delay, pitcheg_vel2attack, pitcheg_vel2hold, pitcheg_vel2decay, pitcheg_vel2sustain, pitcheg_vel2release;
464          int   pitcheg_depth;          int   fileg_depth, pitcheg_depth;
465          float amplfo_delay, amplfo_fade, amplfo_freq, amplfo_depth;          float amplfo_delay, amplfo_fade, amplfo_freq, amplfo_depth;
466          float fillfo_delay, fillfo_fade, fillfo_freq, fillfo_depth;          float fillfo_delay, fillfo_fade, fillfo_freq, fillfo_depth;
467          float pitchlfo_delay, pitchlfo_fade, pitchlfo_freq;          float pitchlfo_delay, pitchlfo_fade, pitchlfo_freq;
468          int pitchlfo_depth;          int pitchlfo_depth;
469            Array<int> pitchlfo_depthcc;
470            
471            LinuxSampler::ArrayList<CC> pitchlfo_freqcc; // 0 to 20 Hz
472            LinuxSampler::ArrayList<CC> fillfo_freqcc; // 0 to 20 Hz
473            LinuxSampler::ArrayList<CC> amplfo_freqcc; // 0 to 20 Hz
474    
475          // envelope generators          // envelope generators
476          LinuxSampler::ArrayList<EG> eg;          LinuxSampler::ArrayList<EG> eg;
477    
478          // low frequency oscillators          // low frequency oscillators
479          LinuxSampler::ArrayList<LFO> lfos;          LinuxSampler::ArrayList<LFO> lfos;
480            
481            LinuxSampler::ArrayList<CC> volume_oncc;
482            LinuxSampler::ArrayList<CC> volume_curvecc; // used only as temporary buffer during the parsing - values are then moved to volume_oncc
483      };      };
484    
485      class Query {      class Query {
# Line 492  namespace sfz Line 546  namespace sfz
546          Instrument* pInstrument;          Instrument* pInstrument;
547          int seq_counter;          int seq_counter;
548      };      };
549        
550        class Curve {
551            public:
552                float v[128];
553                Curve() { for (int i = 0; i < 128; i++) v[i] = 0; }
554                Curve(const Curve& curve) { Copy(curve); }
555                void operator=(const Curve& curve) { Copy(curve); }
556                void Copy(const Curve& curve) { for (int i = 0; i < 128; i++) v[i] = curve.v[i]; }
557        };
558    
559      /////////////////////////////////////////////////////////////      /////////////////////////////////////////////////////////////
560      // class Instrument      // class Instrument
# Line 512  namespace sfz Line 575  namespace sfz
575    
576          /// List of Regions belonging to this Instrument          /// List of Regions belonging to this Instrument
577          std::vector<Region*> regions;          std::vector<Region*> regions;
578            ::LinuxSampler::ArrayList<Curve> curves;
579    
580          friend class File;          friend class File;
581          friend class Query;          friend class Query;
# Line 568  namespace sfz Line 632  namespace sfz
632          EG& eg(int x);          EG& eg(int x);
633          EGNode& egnode(int x, int y);          EGNode& egnode(int x, int y);
634          LFO& lfo(int x);          LFO& lfo(int x);
635            void copyCurves(LinuxSampler::ArrayList<CC>& curves, LinuxSampler::ArrayList<CC>& dest);
636    
637          std::string currentDir;          std::string currentDir;
638          /// Pointer to the Instrument belonging to this file          /// Pointer to the Instrument belonging to this file
639          Instrument* _instrument;          Instrument* _instrument;
640    
641          // state variables          // state variables
642          enum section_t { UNKNOWN, GROUP, REGION, CONTROL };          enum section_t { UNKNOWN, GROUP, REGION, CONTROL, CURVE };
643          section_t _current_section;          section_t _current_section;
644          Region* _current_region;          Region* _current_region;
645          Group* _current_group;          Group* _current_group;
646            Curve* _current_curve;
647          Definition* pCurDef;          Definition* pCurDef;
648    
649          // control header directives          // control header directives

Legend:
Removed from v.2220  
changed lines
  Added in v.2230

  ViewVC Help
Powered by ViewVC