46 Flute( StkFloat lowestFrequency );
73 void noteOn( StkFloat frequency, StkFloat amplitude );
76 void noteOff( StkFloat amplitude );
82 StkFloat
tick(
unsigned int channel = 0 );
105 StkFloat lastFrequency_;
106 StkFloat maxPressure_;
107 StkFloat jetReflection_;
108 StkFloat endReflection_;
110 StkFloat vibratoGain_;
111 StkFloat outputGain_;
118 StkFloat pressureDiff;
119 StkFloat breathPressure;
122 breathPressure = maxPressure_ * adsr_.
tick();
123 breathPressure += breathPressure * ( noiseGain_ * noise_.
tick() + vibratoGain_ * vibrato_.
tick() );
125 StkFloat temp = -filter_.
tick( boreDelay_.
lastOut() );
126 temp = dcBlock_.
tick( temp );
128 pressureDiff = breathPressure - (jetReflection_ * temp);
129 pressureDiff = jetDelay_.
tick( pressureDiff );
130 pressureDiff = jetTable_.
tick( pressureDiff ) + (endReflection_ * temp);
131 lastFrame_[0] = (StkFloat) 0.3 * boreDelay_.
tick( pressureDiff );
133 lastFrame_[0] *= outputGain_;
134 return lastFrame_[0];
139 unsigned int nChannels = lastFrame_.
channels();
140 #if defined(_STK_DEBUG_)
141 if ( channel > frames.
channels() - nChannels ) {
142 oStream_ <<
"Flute::tick(): channel and StkFrames arguments are incompatible!";
147 StkFloat *samples = &frames[channel];
148 unsigned int j, hop = frames.
channels() - nChannels;
149 if ( nChannels == 1 ) {
150 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
154 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
156 for ( j=1; j<nChannels; j++ )
157 *samples++ = lastFrame_[j];