Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


Sampler.h

00001 #ifndef STK_SAMPLER_H
00002 #define STK_SAMPLER_H
00003 
00004 #include "Instrmnt.h"
00005 #include "ADSR.h"
00006 #include "FileLoop.h"
00007 #include "OnePole.h"
00008 
00009 namespace stk {
00010 
00011 /***************************************************/
00020 /***************************************************/
00021 
00022 class Sampler : public Instrmnt
00023 {
00024  public:
00026   Sampler( void );
00027 
00029   virtual ~Sampler( void );
00030 
00032   void clear( void );
00033 
00035   virtual void setFrequency( StkFloat frequency ) = 0;
00036 
00038   void keyOn( void );
00039 
00041   void keyOff( void );
00042 
00044   virtual void noteOff( StkFloat amplitude );
00045 
00047   virtual void controlChange( int number, StkFloat value ) = 0;
00048 
00050   virtual StkFloat tick( unsigned int channel = 0 ) = 0;
00051 
00053 
00060   virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 ) = 0;
00061 
00062  protected:
00063 
00064   ADSR adsr_;
00065   std::vector<FileWvIn *> attacks_;
00066   std::vector<FileLoop *> 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 } // stk namespace
00077 
00078 #endif

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