33 Modal(
unsigned int modes = 4 );
45 void setRatioAndRadius(
unsigned int modeIndex, StkFloat ratio, StkFloat radius );
54 void setModeGain(
unsigned int modeIndex, StkFloat gain );
57 virtual void strike( StkFloat amplitude );
60 void damp( StkFloat amplitude );
63 void noteOn( StkFloat frequency, StkFloat amplitude );
66 void noteOff( StkFloat amplitude );
72 StkFloat
tick(
unsigned int channel = 0 );
93 std::vector<StkFloat> ratios_;
94 std::vector<StkFloat> radii_;
96 StkFloat vibratoGain_;
99 StkFloat stickHardness_;
100 StkFloat strikePosition_;
101 StkFloat baseFrequency_;
106 StkFloat temp = masterGain_ * onepole_.
tick( wave_->
tick() * envelope_.
tick() );
108 StkFloat temp2 = 0.0;
109 for (
unsigned int i=0; i<nModes_; i++ )
110 temp2 += filters_[i]->
tick(temp);
112 temp2 -= temp2 * directGain_;
113 temp2 += directGain_ * temp;
115 if ( vibratoGain_ != 0.0 ) {
117 temp = 1.0 + ( vibrato_.
tick() * vibratoGain_ );
118 temp2 = temp * temp2;
121 lastFrame_[0] = temp2;
122 return lastFrame_[0];
127 unsigned int nChannels = lastFrame_.
channels();
128 #if defined(_STK_DEBUG_)
129 if ( channel > frames.
channels() - nChannels ) {
130 oStream_ <<
"Modal::tick(): channel and StkFrames arguments are incompatible!";
135 StkFloat *samples = &frames[channel];
136 unsigned int j, hop = frames.
channels() - nChannels;
137 if ( nChannels == 1 ) {
138 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
142 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
144 for ( j=1; j<nChannels; j++ )
145 *samples++ = lastFrame_[j];