1 #ifndef STK_FUNCTION_H 2 #define STK_FUNCTION_H 3 4 #include "Stk.h" 5 6 namespace stk { 7 8 /***************************************************/ 9 /*! \class Function 10 \brief STK abstract function parent class. 11 12 This class provides common functionality for STK classes that 13 implement tables or other types of input to output function 14 mappings. 15 16 by Perry R. Cook and Gary P. Scavone, 1995--2021. 17 */ 18 /***************************************************/ 19 20 class Function : public Stk 21 { 22 public: 23 //! Class constructor. Function(void)24 Function( void ) { lastFrame_.resize( 1, 1, 0.0 ); }; 25 26 //! Return the last computed output sample. lastOut(void)27 StkFloat lastOut( void ) const { return lastFrame_[0]; }; 28 29 //! Take one sample input and compute one sample of output. 30 virtual StkFloat tick( StkFloat input ) = 0; 31 32 protected: 33 34 StkFrames lastFrame_; 35 36 }; 37 38 } // stk namespace 39 40 #endif 41 42