You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
869B

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