63 void setVoiced( StkFloat vGain ) { voiced_->setGainTarget(vGain); };
66 void setUnVoiced( StkFloat nGain ) { noiseEnv_.setTarget(nGain); };
75 void speak(
void ) { voiced_->noteOn(); };
81 void noteOn( StkFloat frequency, StkFloat amplitude );
90 StkFloat
tick(
unsigned int channel = 0 );
113inline StkFloat VoicForm :: tick(
unsigned int )
116 temp = onepole_.
tick( onezero_.tick( voiced_->tick() ) );
117 temp += noiseEnv_.tick() * noise_.tick();
118 lastFrame_[0] = filters_[0].tick(temp);
119 lastFrame_[0] += filters_[1].tick(temp);
120 lastFrame_[0] += filters_[2].tick(temp);
121 lastFrame_[0] += filters_[3].tick(temp);
129 return lastFrame_[0];
134 unsigned int nChannels = lastFrame_.
channels();
135#if defined(_STK_DEBUG_)
136 if ( channel > frames.
channels() - nChannels ) {
137 oStream_ <<
"VoicForm::tick(): channel and StkFrames arguments are incompatible!";
142 StkFloat *samples = &frames[channel];
143 unsigned int j, hop = frames.
channels() - nChannels;
144 if ( nChannels == 1 ) {
145 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
149 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
151 for ( j=1; j<nChannels; j++ )
152 *samples++ = lastFrame_[j];
STK linear line envelope class.
Definition Envelope.h:23
Instrmnt(void)
Class constructor.
Definition Instrmnt.h:23
STK noise generator.
Definition Noise.h:22
STK one-pole filter class.
Definition OnePole.h:21
STK one-zero filter class.
Definition OneZero.h:21
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition OneZero.h:79
STK "singing" looped soundfile class.
Definition SingWave.h:26
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
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:6