Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   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 "WaveLoop.h"
00018 #include "OnePole.h"
00019 
00020 class Sampler : public Instrmnt
00021 {
00022  public:
00024   Sampler();
00025 
00027   virtual ~Sampler();
00028 
00030   void clear();
00031 
00033   virtual void setFrequency(StkFloat frequency) = 0;
00034 
00036   void keyOn();
00037 
00039   void keyOff();
00040 
00042   virtual void noteOff(StkFloat amplitude);
00043 
00045   virtual void controlChange(int number, StkFloat value) = 0;
00046 
00047  protected:
00048 
00049   virtual StkFloat computeSample( void ) = 0;
00050 
00051   ADSR adsr_;
00052   std::vector<FileWvIn *> attacks_;
00053   std::vector<WaveLoop *> loops_;
00054   OnePole filter_;
00055   StkFloat baseFrequency_;
00056   std::vector<StkFloat> attackRatios_;
00057   std::vector<StkFloat> loopRatios_;
00058   StkFloat attackGain_;
00059   StkFloat loopGain_;
00060 
00061 };
00062 
00063 #endif

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