 
    
   
Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial
   33   Modal( 
unsigned int modes = 4 );
 
   57   virtual void strike( StkFloat amplitude );
 
   60   void damp( StkFloat amplitude );
 
   63   void noteOn( StkFloat frequency, 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];
 
  
STK one-pole filter class.
Definition: OnePole.h:21
STK sinusoid oscillator class.
Definition: SineWave.h:26
STK audio file input class.
Definition: FileWvIn.h:53
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:21
void clear(void)
Reset and clear all internal state.
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: OnePole.h:80
void setMasterGain(StkFloat aGain)
Set the master gain.
Definition: Modal.h:48
virtual void controlChange(int number, StkFloat value)=0
Perform the control change specified by number and value (0.0 - 128.0).
Modal(unsigned int modes=4)
Class constructor, taking the desired number of modes to create.
An STK class to handle vectorized audio data.
Definition: Stk.h:276
StkFloat tick(void)
Compute and return one output sample.
Definition: SineWave.h:99
STK resonance model abstract base class.
Definition: Modal.h:27
STK linear line envelope class.
Definition: Envelope.h:22
StkFloat tick(void)
Compute and return one output sample.
Definition: Envelope.h:88
StkFloat tick(unsigned int channel=0)
Compute and return one output sample.
Definition: Modal.h:104
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:404
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
virtual void setFrequency(StkFloat frequency)
Set instrument parameters for a particular frequency.
void noteOn(StkFloat frequency, StkFloat amplitude)
Start a note with the given frequency and amplitude.
void setRatioAndRadius(unsigned int modeIndex, StkFloat ratio, StkFloat radius)
Set the ratio and radius for a specified mode filter.
void damp(StkFloat amplitude)
Damp modes with a given decay factor (0.0 - 1.0).
virtual void strike(StkFloat amplitude)
Initiate a strike with the given amplitude (0.0 - 1.0).
The STK namespace.
Definition: ADSR.h:6
STK instrument abstract base class.
Definition: Instrmnt.h:20
void noteOff(StkFloat amplitude)
Stop a note with the given amplitude (speed of decay).
virtual StkFloat tick(unsigned int channel=0)
Compute a sample frame and return the specified channel value.
void setDirectGain(StkFloat aGain)
Set the direct gain.
Definition: Modal.h:51
void setModeGain(unsigned int modeIndex, StkFloat gain)
Set the gain for a specified mode filter.
virtual ~Modal(void)
Class destructor.