Version 4.0

This commit is contained in:
Gary Scavone
2013-09-25 14:50:19 +02:00
committed by Stephen Sinclair
parent 3f126af4e5
commit 81475b04c5
473 changed files with 36355 additions and 28396 deletions

View File

@@ -1,26 +1,53 @@
/******************************************/
/* Instrument SuperClass for Toolkit96 */
/* Perry R. Cook, Princeton University */
/******************************************/
#if !defined(__Instrmnt_h)
#define __Instrmnt_h
#include "Object.h"
class Instrmnt : public Object
{
protected:
MY_FLOAT lastOutput;
public:
Instrmnt();
virtual ~Instrmnt();
MY_FLOAT lastOut();
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
virtual void noteOff(MY_FLOAT amp);
virtual void setFreq(MY_FLOAT frequency);
virtual MY_FLOAT tick();
virtual void controlChange(int number, MY_FLOAT value);
};
#endif
/***************************************************/
/*! \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 - 2002.
*/
/***************************************************/
#if !defined(__INSTRMNT_H)
#define __INSTRMNT_H
#include "Stk.h"
#include <iostream.h>
class Instrmnt : public Stk
{
public:
//! Default constructor.
Instrmnt();
//! Class destructor.
virtual ~Instrmnt();
//! Start a note with the given frequency and amplitude.
virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude) = 0;
//! Stop a note with the given amplitude (speed of decay).
virtual void noteOff(MY_FLOAT amplitude) = 0;
//! Set instrument parameters for a particular frequency.
virtual void setFrequency(MY_FLOAT frequency);
//! Return the last output value.
MY_FLOAT lastOut() const;
//! Compute one output sample.
virtual MY_FLOAT tick() = 0;
//! Computer \e vectorSize outputs and return them in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
virtual void controlChange(int number, MY_FLOAT value);
protected:
MY_FLOAT lastOutput;
};
#endif