45 Clarinet( StkFloat lowestFrequency = 8.0 );
63 void noteOn( StkFloat frequency, StkFloat amplitude );
66 void noteOff( StkFloat amplitude );
72 StkFloat
tick(
unsigned int channel = 0 );
95 StkFloat vibratoGain_;
100 StkFloat pressureDiff;
101 StkFloat breathPressure;
104 breathPressure = envelope_.
tick();
105 breathPressure += breathPressure * noiseGain_ * noise_.
tick();
106 breathPressure += breathPressure * vibratoGain_ * vibrato_.
tick();
109 pressureDiff = -0.95 * filter_.
tick( delayLine_.
lastOut() );
112 pressureDiff = pressureDiff - breathPressure;
115 lastFrame_[0] = delayLine_.
tick(breathPressure + pressureDiff * reedTable_.
tick(pressureDiff));
118 lastFrame_[0] *= outputGain_;
120 return lastFrame_[0];
125 unsigned int nChannels = lastFrame_.
channels();
126 #if defined(_STK_DEBUG_)
127 if ( channel > frames.
channels() - nChannels ) {
128 oStream_ <<
"Clarinet::tick(): channel and StkFrames arguments are incompatible!";
133 StkFloat *samples = &frames[channel];
134 unsigned int j, hop = frames.
channels() - nChannels;
135 if ( nChannels == 1 ) {
136 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
140 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
142 for ( j=1; j<nChannels; j++ )
143 *samples++ = lastFrame_[j];