mirror of
https://github.com/thestk/stk
synced 2026-04-22 23:44:36 +00:00
Version 4.0
This commit is contained in:
committed by
Stephen Sinclair
parent
3f126af4e5
commit
81475b04c5
62
include/Moog.h
Normal file
62
include/Moog.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/***************************************************/
|
||||
/*! \class Moog
|
||||
\brief STK moog-like swept filter sampling synthesis class.
|
||||
|
||||
This instrument uses one attack wave, one
|
||||
looped wave, and an ADSR envelope (inherited
|
||||
from the Sampler class) and adds two sweepable
|
||||
formant (FormSwep) filters.
|
||||
|
||||
Control Change Numbers:
|
||||
- Filter Q = 2
|
||||
- Filter Sweep Rate = 4
|
||||
- Vibrato Frequency = 11
|
||||
- Vibrato Gain = 1
|
||||
- Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
#if !defined(__MOOG_H)
|
||||
#define __MOOG_H
|
||||
|
||||
#include "Sampler.h"
|
||||
#include "FormSwep.h"
|
||||
|
||||
class Moog : public Sampler
|
||||
{
|
||||
public:
|
||||
//! Class constructor.
|
||||
Moog();
|
||||
|
||||
//! Class destructor.
|
||||
~Moog();
|
||||
|
||||
//! Set instrument parameters for a particular frequency.
|
||||
virtual void setFrequency(MY_FLOAT frequency);
|
||||
|
||||
//! Start a note with the given frequency and amplitude.
|
||||
virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude);
|
||||
|
||||
//! Set the modulation (vibrato) speed in Hz.
|
||||
void setModulationSpeed(MY_FLOAT mSpeed);
|
||||
|
||||
//! Set the modulation (vibrato) depth.
|
||||
void setModulationDepth(MY_FLOAT mDepth);
|
||||
|
||||
//! Compute one output sample.
|
||||
virtual MY_FLOAT tick();
|
||||
|
||||
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
|
||||
virtual void controlChange(int number, MY_FLOAT value);
|
||||
|
||||
protected:
|
||||
FormSwep *filters[2];
|
||||
MY_FLOAT modDepth;
|
||||
MY_FLOAT filterQ;
|
||||
MY_FLOAT filterRate;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user