Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


Sampler.h

00001 /***************************************************/
00010 /***************************************************/
00011 
00012 #ifndef STK_SAMPLER_H
00013 #define STK_SAMPLER_H
00014 
00015 #include "Instrmnt.h"
00016 #include "ADSR.h"
00017 #include "WvIn.h"
00018 #include "WaveLoop.h"
00019 #include "OnePole.h"
00020 
00021 class Sampler : public Instrmnt
00022 {
00023  public:
00025   Sampler();
00026 
00028   virtual ~Sampler();
00029 
00031   void clear();
00032 
00034   virtual void setFrequency(StkFloat frequency) = 0;
00035 
00037   void keyOn();
00038 
00040   void keyOff();
00041 
00043   virtual void noteOff(StkFloat amplitude);
00044 
00046   virtual StkFloat tick() = 0;
00047 
00049   virtual StkFloat *tick(StkFloat *vector, unsigned int vectorSize) = 0;
00050 
00052 
00058   virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 1 ) = 0;
00059 
00061   virtual void controlChange(int number, StkFloat value) = 0;
00062 
00063  protected:  
00064   ADSR adsr_;
00065   std::vector<WvIn *> attacks_;
00066   std::vector<WaveLoop *> loops_;
00067   OnePole filter_;
00068   StkFloat baseFrequency_;
00069   std::vector<StkFloat> attackRatios_;
00070   std::vector<StkFloat> loopRatios_;
00071   StkFloat attackGain_;
00072   StkFloat loopGain_;
00073 
00074 };
00075 
00076 #endif

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.