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

@@ -6,22 +6,25 @@
modulations to give a nice, natural human
modulation function.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
*/
/***************************************************/
#if !defined(__MODULATE_H)
#define __MODULATE_H
#ifndef STK_MODULATE_H
#define STK_MODULATE_H
#include "Stk.h"
#include "Generator.h"
#include "WaveLoop.h"
#include "SubNoise.h"
#include "OnePole.h"
class Modulate : public Stk
class Modulate : public Generator
{
public:
//! Class constructor.
/*!
An StkError can be thrown if the rawwave path is incorrect.
*/
Modulate();
//! Class destructor.
@@ -31,30 +34,35 @@ class Modulate : public Stk
void reset();
//! Set the periodic (vibrato) rate or frequency in Hz.
void setVibratoRate(MY_FLOAT aRate);
void setVibratoRate(StkFloat rate);
//! Set the periodic (vibrato) gain.
void setVibratoGain(MY_FLOAT aGain);
void setVibratoGain(StkFloat gain);
//! Set the random modulation gain.
void setRandomGain(MY_FLOAT aGain);
void setRandomGain(StkFloat gain);
//! Compute one output sample.
MY_FLOAT tick();
StkFloat tick();
//! Return \e vectorSize outputs in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Compute \e vectorSize outputs and return them in \e vector.
StkFloat *tick( StkFloat *vector, unsigned int vectorSize );
//! Return the last computed output value.
MY_FLOAT lastOut() const;
//! 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.
*/
StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
protected:
WaveLoop *vibrato;
SubNoise *noise;
OnePole *filter;
MY_FLOAT vibratoGain;
MY_FLOAT randomGain;
MY_FLOAT lastOutput;
WaveLoop *vibrato_;
SubNoise noise_;
OnePole filter_;
StkFloat vibratoGain_;
StkFloat randomGain_;
};