mirror of
https://github.com/thestk/stk
synced 2026-01-16 22:31:52 +00:00
Version 4.0
This commit is contained in:
committed by
Stephen Sinclair
parent
3f126af4e5
commit
81475b04c5
61
include/Modulate.h
Normal file
61
include/Modulate.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/***************************************************/
|
||||
/*! \class Modulate
|
||||
\brief STK periodic/random modulator.
|
||||
|
||||
This class combines random and periodic
|
||||
modulations to give a nice, natural human
|
||||
modulation function.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
#if !defined(__MODULATE_H)
|
||||
#define __MODULATE_H
|
||||
|
||||
#include "Stk.h"
|
||||
#include "WaveLoop.h"
|
||||
#include "SubNoise.h"
|
||||
#include "OnePole.h"
|
||||
|
||||
class Modulate : public Stk
|
||||
{
|
||||
public:
|
||||
//! Class constructor.
|
||||
Modulate();
|
||||
|
||||
//! Class destructor.
|
||||
~Modulate();
|
||||
|
||||
//! Reset internal state.
|
||||
void reset();
|
||||
|
||||
//! Set the periodic (vibrato) rate or frequency in Hz.
|
||||
void setVibratoRate(MY_FLOAT aRate);
|
||||
|
||||
//! Set the periodic (vibrato) gain.
|
||||
void setVibratoGain(MY_FLOAT aGain);
|
||||
|
||||
//! Set the random modulation gain.
|
||||
void setRandomGain(MY_FLOAT aGain);
|
||||
|
||||
//! Compute one output sample.
|
||||
MY_FLOAT tick();
|
||||
|
||||
//! Return \e vectorSize outputs in \e vector.
|
||||
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
|
||||
|
||||
//! Return the last computed output value.
|
||||
MY_FLOAT lastOut() const;
|
||||
|
||||
protected:
|
||||
WaveLoop *vibrato;
|
||||
SubNoise *noise;
|
||||
OnePole *filter;
|
||||
MY_FLOAT vibratoGain;
|
||||
MY_FLOAT randomGain;
|
||||
MY_FLOAT lastOutput;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user