45 void noteOn( StkFloat frequency, StkFloat amplitude );
57 StkFloat
tick(
unsigned int channel = 0 );
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!";
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];
StkFloat tick(void)
Compute and return one output sample.
Definition: ADSR.h:117
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
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: OnePole.h:80
STK sampling synthesis abstract base class.
Definition: Sampler.h:25
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.
The STK namespace.
Definition: ADSR.h:8