/***************************************************/ /*! \class Instrmnt \brief STK instrument abstract base class. This class provides a common interface for all STK instruments. by Perry R. Cook and Gary P. Scavone, 1995 - 2005. */ /***************************************************/ #include "Instrmnt.h" using namespace Nyq; Instrmnt :: Instrmnt() { } Instrmnt :: ~Instrmnt() { } void Instrmnt :: setFrequency(StkFloat frequency) { errorString_ << "Instrmnt::setFrequency: virtual setFrequency function call!"; handleError( StkError::WARNING ); } StkFloat Instrmnt :: lastOut() const { return lastOutput_; } // Support for stereo output: StkFloat Instrmnt :: lastOutLeft(void) const { return 0.5 * lastOutput_; } StkFloat Instrmnt :: lastOutRight(void) const { return 0.5 * lastOutput_; } StkFloat Instrmnt :: tick( void ) { return computeSample(); } StkFrames& Instrmnt :: tick( StkFrames& frames, unsigned int channel ) { if ( channel >= frames.channels() ) { errorString_ << "Instrmnt::tick(): channel and StkFrames arguments are incompatible!"; handleError( StkError::FUNCTION_ARGUMENT ); } if ( frames.channels() == 1 ) { for ( unsigned int i=0; i