55 void noteOn( StkFloat frequency, StkFloat amplitude );
58 StkFloat
tick(
unsigned int channel = 0 );
78 if ( modDepth_ > 0.0 ) {
79 temp = 1.0 + ( modDepth_ * vibrato_.
tick() * 0.1 );
80 waves_[0]->setFrequency( baseFrequency_ * temp * ratios_[0] );
81 waves_[1]->setFrequency( baseFrequency_ * temp * ratios_[1] );
82 waves_[2]->setFrequency( baseFrequency_ * temp * ratios_[2] );
83 waves_[3]->setFrequency( baseFrequency_ * temp * ratios_[3] );
86 waves_[3]->addPhaseOffset( twozero_.
lastOut() );
87 temp = control1_ * 2.0 * gains_[3] * adsr_[3]->tick() * waves_[3]->tick();
88 twozero_.
tick( temp );
90 temp += control2_ * 2.0 * gains_[2] * adsr_[2]->tick() * waves_[2]->tick();
91 temp += gains_[1] * adsr_[1]->tick() * waves_[1]->tick();
92 temp += gains_[0] * adsr_[0]->tick() * waves_[0]->tick();
94 lastFrame_[0] = temp * 0.125;
100 unsigned int nChannels = lastFrame_.
channels();
101 #if defined(_STK_DEBUG_)
102 if ( channel > frames.
channels() - nChannels ) {
103 oStream_ <<
"BeeThree::tick(): channel and StkFrames arguments are incompatible!";
108 StkFloat *samples = &frames[channel];
109 unsigned int j, hop = frames.
channels() - nChannels;
110 if ( nChannels == 1 ) {
111 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
115 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
117 for ( j=1; j<nChannels; j++ )
118 *samples++ = lastFrame_[j];
STK Hammond-oid organ FM synthesis instrument.
Definition: BeeThree.h:43
StkFloat tick(unsigned int channel=0)
Compute and return one output sample.
Definition: BeeThree.h:74
void noteOn(StkFloat frequency, StkFloat amplitude)
Start a note with the given frequency and amplitude.
BeeThree(void)
Class constructor.
~BeeThree(void)
Class destructor.
STK abstract FM synthesis base class.
Definition: FM.h:39
StkFloat tick(void)
Compute and return one output sample.
Definition: SineWave.h:99
An STK class to handle vectorized audio data.
Definition: Stk.h:287
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:415
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:418
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
StkFloat lastOut(void) const
Return the last computed output value.
Definition: TwoZero.h:60
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: TwoZero.h:92
The STK namespace.
Definition: ADSR.h:8