45 void noteOn( StkFloat frequency, StkFloat amplitude );
57 StkFloat
tick(
unsigned int channel = 0 );
78inline StkFloat Moog :: tick(
unsigned int )
82 if ( modDepth_ != 0.0 ) {
83 temp = loops_[1]->
tick() * modDepth_;
84 loops_[0]->setFrequency( baseFrequency_ * (1.0 + temp) );
87 temp = attackGain_ * attacks_[0]->tick();
88 temp += loopGain_ * loops_[0]->tick();
89 temp = filter_.tick( temp );
91 temp = filters_[0].tick( temp );
92 lastFrame_[0] = filters_[1].tick( temp );
93 return lastFrame_[0] * 6.0;
98 unsigned int nChannels = lastFrame_.
channels();
99#if defined(_STK_DEBUG_)
100 if ( channel > frames.
channels() - nChannels ) {
101 oStream_ <<
"Moog::tick(): channel and StkFrames arguments are incompatible!";
102 handleError( StkError::FUNCTION_ARGUMENT );
106 StkFloat *samples = &frames[channel];
107 unsigned int j, hop = frames.
channels() - nChannels;
108 if ( nChannels == 1 ) {
109 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
113 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
115 for ( j=1; j<nChannels; j++ )
116 *samples++ = lastFrame_[j];
STK moog-like swept filter sampling synthesis class.
Definition Moog.h:30
Moog(void)
Class constructor.
void setModulationDepth(StkFloat mDepth)
Set the modulation (vibrato) depth.
Definition Moog.h:51
void noteOn(StkFloat frequency, StkFloat amplitude)
Start a note with the given frequency and amplitude.
void setFrequency(StkFloat frequency)
Set instrument parameters for a particular frequency.
StkFloat tick(unsigned int channel=0)
Compute and return one output sample.
Definition Moog.h:78
~Moog(void)
Class destructor.
void controlChange(int number, StkFloat value)
Perform the control change specified by number and value (0.0 - 128.0).
void setModulationSpeed(StkFloat mSpeed)
Set the modulation (vibrato) speed in Hz.
Definition Moog.h:48
STK sampling synthesis abstract base class.
Definition Sampler.h:23
An STK class to handle vectorized audio data.
Definition Stk.h:279
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition Stk.h:416
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition Stk.h:419
The STK namespace.
Definition ADSR.h:6