Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


Instrmnt.h

00001 /***************************************************/
00010 /***************************************************/
00011 
00012 #ifndef STK_INSTRMNT_H
00013 #define STK_INSTRMNT_H
00014 
00015 #include "Stk.h"
00016 
00017 class Instrmnt : public Stk
00018 {
00019  public:
00021   Instrmnt();
00022 
00024   virtual ~Instrmnt();
00025 
00027   virtual void noteOn(StkFloat frequency, StkFloat amplitude) = 0;
00028 
00030   virtual void noteOff(StkFloat amplitude) = 0;
00031 
00033   virtual void setFrequency(StkFloat frequency);
00034 
00036   StkFloat lastOut() const;
00037 
00039   StkFloat lastOutLeft() const;
00040 
00042   StkFloat lastOutRight() const;
00043 
00045   StkFloat tick( void );
00046 
00048 
00054   StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
00055 
00057   virtual void controlChange(int number, StkFloat value);
00058 
00059  protected:
00060 
00061   // This abstract function must be implemented in all subclasses.
00062   // It is used to get around a C++ problem with overloaded virtual
00063   // functions.
00064   virtual StkFloat computeSample( void ) = 0;
00065 
00066   StkFloat lastOutput_;
00067 
00068 };
00069 
00070 #endif

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