
Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
44 Bowed( StkFloat lowestFrequency = 8.0 );
56 void setVibrato( StkFloat gain ) { vibratoGain_ = gain; };
59 void startBowing( StkFloat amplitude, StkFloat rate );
65 void noteOn( StkFloat frequency, StkFloat amplitude );
68 void noteOff( StkFloat amplitude );
74 StkFloat
tick(
unsigned int channel = 0 );
97 StkFloat maxVelocity_;
99 StkFloat vibratoGain_;
106 StkFloat bowVelocity = maxVelocity_ * adsr_.
tick();
107 StkFloat bridgeReflection = -stringFilter_.
tick( bridgeDelay_.
lastOut() );
108 StkFloat nutReflection = -neckDelay_.
lastOut();
109 StkFloat stringVelocity = bridgeReflection + nutReflection;
110 StkFloat deltaV = bowVelocity - stringVelocity;
112 StkFloat newVelocity = 0.0;
114 newVelocity = deltaV * bowTable_.
tick( deltaV );
115 neckDelay_.
tick( bridgeReflection + newVelocity);
116 bridgeDelay_.
tick(nutReflection + newVelocity);
118 if ( vibratoGain_ > 0.0 ) {
119 neckDelay_.
setDelay( (baseDelay_ * (1.0 - betaRatio_) ) +
120 (baseDelay_ * vibratoGain_ * vibrato_.
tick()) );
123 lastFrame_[0] = 0.1248 * bodyFilters_[5].
tick( bodyFilters_[4].
tick( bodyFilters_[3].
tick( bodyFilters_[2].
tick( bodyFilters_[1].
tick( bodyFilters_[0].
tick( bridgeDelay_.
lastOut() ) ) ) ) ) );
125 return lastFrame_[0];
130 unsigned int nChannels = lastFrame_.
channels();
131 #if defined(_STK_DEBUG_)
132 if ( channel > frames.
channels() - nChannels ) {
133 oStream_ <<
"Bowed::tick(): channel and StkFrames arguments are incompatible!";
138 StkFloat *samples = &frames[channel];
139 unsigned int j, hop = frames.
channels() - nChannels;
140 if ( nChannels == 1 ) {
141 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
145 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
147 for ( j=1; j<nChannels; j++ )
148 *samples++ = lastFrame_[j];
STK one-pole filter class.
Definition: OnePole.h:20
void setVibrato(StkFloat gain)
Set vibrato gain.
Definition: Bowed.h:56
STK ADSR envelope class.
Definition: ADSR.h:24
STK sinusoid oscillator class.
Definition: SineWave.h:25
StkFloat tick(StkFloat input)
Take one sample input and map to one sample of output.
Definition: BowTable.h:84
Bowed(StkFloat lowestFrequency=8.0)
Class constructor, taking the lowest desired playing frequency.
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:407
STK biquad (two-pole, two-zero) filter class.
Definition: BiQuad.h:20
STK bowed string instrument class.
Definition: Bowed.h:40
~Bowed(void)
Class destructor.
void stopBowing(StkFloat rate)
Decrease breath pressure with given rate of decrease.
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: OnePole.h:80
STK linear interpolating delay line class.
Definition: DelayL.h:27
void noteOn(StkFloat frequency, StkFloat amplitude)
Start a note with the given frequency and amplitude.
StkFloat lastOut(void) const
Return the last computed output value.
Definition: DelayL.h:76
An STK class to handle vectorized audio data.
Definition: Stk.h:275
StkFloat tick(void)
Compute and return one output sample.
Definition: SineWave.h:99
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:404
void controlChange(int number, StkFloat value)
Perform the control change specified by number and value (0.0 - 128.0).
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
void setFrequency(StkFloat frequency)
Set instrument parameters for a particular frequency.
void startBowing(StkFloat amplitude, StkFloat rate)
Apply breath pressure to instrument with given amplitude and rate of increase.
void noteOff(StkFloat amplitude)
Stop a note with the given amplitude (speed of decay).
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: DelayL.h:163
void clear(void)
Reset and clear all internal state.
StkFloat tick(unsigned int channel=0)
Compute and return one output sample.
Definition: Bowed.h:104
void setDelay(StkFloat delay)
Set the delay-line length.
Definition: DelayL.h:136
The STK namespace.
Definition: ADSR.h:6
StkFloat tick(void)
Compute and return one output sample.
Definition: ADSR.h:115
STK instrument abstract base class.
Definition: Instrmnt.h:19
StkFloat tick(StkFloat input)
Input one sample to the filter and return a reference to one output.
Definition: BiQuad.h:119
STK bowed string table class.
Definition: BowTable.h:22