mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
69 lines
1.8 KiB
C++
69 lines
1.8 KiB
C++
/***************************************************/
|
|
/*! \class PercFlut
|
|
\brief STK percussive flute FM synthesis instrument.
|
|
|
|
This class implements algorithm 4 of the TX81Z.
|
|
|
|
\code
|
|
Algorithm 4 is : 4->3--\
|
|
2-- + -->1-->Out
|
|
\endcode
|
|
|
|
Control Change Numbers:
|
|
- Total Modulator Index = 2
|
|
- Modulator Crossfade = 4
|
|
- LFO Speed = 11
|
|
- LFO Depth = 1
|
|
- ADSR 2 & 4 Target = 128
|
|
|
|
The basic Chowning/Stanford FM patent expired
|
|
in 1995, but there exist follow-on patents,
|
|
mostly assigned to Yamaha. If you are of the
|
|
type who should worry about this (making
|
|
money) worry away.
|
|
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
|
|
*/
|
|
/***************************************************/
|
|
|
|
#ifndef STK_PERCFLUT_H
|
|
#define STK_PERCFLUT_H
|
|
|
|
#include "FM.h"
|
|
|
|
class PercFlut : public FM
|
|
{
|
|
public:
|
|
//! Class constructor.
|
|
/*!
|
|
An StkError will be thrown if the rawwave path is incorrectly set.
|
|
*/
|
|
PercFlut();
|
|
|
|
//! Class destructor.
|
|
~PercFlut();
|
|
|
|
//! Set instrument parameters for a particular frequency.
|
|
void setFrequency(StkFloat frequency);
|
|
|
|
//! Start a note with the given frequency and amplitude.
|
|
void noteOn(StkFloat frequency, StkFloat amplitude);
|
|
|
|
//! Compute one output sample.
|
|
StkFloat tick();
|
|
|
|
//! Computer \e vectorSize outputs and return them in \e vector.
|
|
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.
|
|
*/
|
|
StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
|
|
};
|
|
|
|
#endif
|