57 BlowHole( StkFloat lowestFrequency );
72 void setVent( StkFloat newValue );
81 void noteOn( StkFloat frequency, StkFloat amplitude );
84 void noteOff( StkFloat amplitude );
90 StkFloat
tick(
unsigned int channel = 0 );
116 StkFloat outputGain_;
118 StkFloat vibratoGain_;
123 StkFloat pressureDiff;
124 StkFloat breathPressure;
128 breathPressure = envelope_.
tick();
129 breathPressure += breathPressure * noiseGain_ * noise_.
tick();
130 breathPressure += breathPressure * vibratoGain_ * vibrato_.
tick();
133 pressureDiff = delays_[0].
lastOut() - breathPressure;
136 StkFloat pa = breathPressure + pressureDiff * reedTable_.
tick( pressureDiff );
137 StkFloat pb = delays_[1].
lastOut();
140 lastFrame_[0] = delays_[0].
tick( vent_.
lastOut()+pb );
141 lastFrame_[0] *= outputGain_;
146 StkFloat pth = tonehole_.
lastOut();
147 temp = scatter_ * (pa + pb - 2 * pth);
149 delays_[2].
tick( filter_.
tick(pa + temp) * -0.95 );
150 delays_[1].
tick( pb + temp );
151 tonehole_.
tick( pa + pb - pth + temp );
153 return lastFrame_[0];
158 unsigned int nChannels = lastFrame_.
channels();
159 #if defined(_STK_DEBUG_)
160 if ( channel > frames.
channels() - nChannels ) {
161 oStream_ <<
"BlowHole::tick(): channel and StkFrames arguments are incompatible!";
166 StkFloat *samples = &frames[channel];
167 unsigned int j, hop = frames.
channels() - nChannels;
168 if ( nChannels == 1 ) {
169 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
173 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
175 for ( j=1; j<nChannels; j++ )
176 *samples++ = lastFrame_[j];