56 void noteOn( StkFloat frequency, StkFloat amplitude );
59 StkFloat
tick(
unsigned int channel = 0 );
79 temp = gains_[1] * adsr_[1]->tick() * waves_[1]->tick();
80 temp = temp * control1_;
82 waves_[0]->addPhaseOffset( temp );
83 waves_[3]->addPhaseOffset( twozero_.
lastOut() );
84 temp = gains_[3] * adsr_[3]->tick() * waves_[3]->tick();
87 waves_[2]->addPhaseOffset( temp );
88 temp = ( 1.0 - (control2_ * 0.5)) * gains_[0] * adsr_[0]->
tick() * waves_[0]->tick();
89 temp += control2_ * 0.5 * gains_[2] * adsr_[2]->tick() * waves_[2]->tick();
92 temp2 = vibrato_.
tick() * modDepth_;
93 temp = temp * (1.0 + temp2);
95 lastFrame_[0] = temp * 0.5;
101 unsigned int nChannels = lastFrame_.
channels();
102 #if defined(_STK_DEBUG_)
103 if ( channel > frames.
channels() - nChannels ) {
104 oStream_ <<
"Rhodey::tick(): channel and StkFrames arguments are incompatible!";
109 StkFloat *samples = &frames[channel];
110 unsigned int j, hop = frames.
channels() - nChannels;
111 if ( nChannels == 1 ) {
112 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
116 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
118 for ( j=1; j<nChannels; j++ )
119 *samples++ = lastFrame_[j];