Version 4.2.0

This commit is contained in:
Gary Scavone
2009-03-24 23:02:14 -04:00
committed by Stephen Sinclair
parent cf06b7598b
commit a6381b9d38
281 changed files with 17152 additions and 12000 deletions

View File

@@ -5,15 +5,14 @@
This class provides a common interface for
all STK instruments.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
*/
/***************************************************/
#if !defined(__INSTRMNT_H)
#define __INSTRMNT_H
#ifndef STK_INSTRMNT_H
#define STK_INSTRMNT_H
#include "Stk.h"
#include <iostream>
class Instrmnt : public Stk
{
@@ -25,34 +24,43 @@ class Instrmnt : public Stk
virtual ~Instrmnt();
//! Start a note with the given frequency and amplitude.
virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude) = 0;
virtual void noteOn(StkFloat frequency, StkFloat amplitude) = 0;
//! Stop a note with the given amplitude (speed of decay).
virtual void noteOff(MY_FLOAT amplitude) = 0;
virtual void noteOff(StkFloat amplitude) = 0;
//! Set instrument parameters for a particular frequency.
virtual void setFrequency(MY_FLOAT frequency);
virtual void setFrequency(StkFloat frequency);
//! Return the last output value.
MY_FLOAT lastOut() const;
StkFloat lastOut() const;
//! Return the last left output value.
MY_FLOAT lastOutLeft() const;
StkFloat lastOutLeft() const;
//! Return the last right output value.
MY_FLOAT lastOutRight() const;
StkFloat lastOutRight() const;
//! Compute one output sample.
virtual MY_FLOAT tick() = 0;
virtual StkFloat tick() = 0;
//! Computer \e vectorSize outputs and return them in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
virtual StkFloat *tick(StkFloat *vector, unsigned int vectorSize);
//! Fill a channel of the StkFrames object with computed outputs.
/*!
The \c channel argument should be one or greater (the first
channel is specified by 1). An StkError will be thrown if the \c
channel argument is zero or it is greater than the number of
channels in the StkFrames object.
*/
virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
virtual void controlChange(int number, MY_FLOAT value);
virtual void controlChange(int number, StkFloat value);
protected:
MY_FLOAT lastOutput;
StkFloat lastOutput_;
};