Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


Modal Class Reference

#include <Modal.h>

Inheritance diagram for Modal:

Instrmnt Stk ModalBar List of all members.

Detailed Description

STK resonance model instrument.

This class contains an excitation wavetable, an envelope, an oscillator, and N resonances (non-sweeping BiQuad filters), where N is set during instantiation.

by Perry R. Cook and Gary P. Scavone, 1995 - 2004.

Definition at line 23 of file Modal.h.

Public Member Functions

 Modal (unsigned int modes=4)
 Class constructor, taking the desired number of modes to create.

virtual ~Modal ()
 Class destructor.

void clear ()
 Reset and clear all internal state.

virtual void setFrequency (StkFloat frequency)
 Set instrument parameters for a particular frequency.

void setRatioAndRadius (unsigned int modeIndex, StkFloat ratio, StkFloat radius)
 Set the ratio and radius for a specified mode filter.

void setMasterGain (StkFloat aGain)
 Set the master gain.

void setDirectGain (StkFloat aGain)
 Set the direct gain.

void setModeGain (unsigned int modeIndex, StkFloat gain)
 Set the gain for a specified mode filter.

virtual void strike (StkFloat amplitude)
 Initiate a strike with the given amplitude (0.0 - 1.0).

void damp (StkFloat amplitude)
 Damp modes with a given decay factor (0.0 - 1.0).

void noteOn (StkFloat frequency, StkFloat amplitude)
 Start a note with the given frequency and amplitude.

void noteOff (StkFloat amplitude)
 Stop a note with the given amplitude (speed of decay).

virtual StkFloat tick ()
 Compute one output sample.

virtual StkFloat * tick (StkFloat *vector, unsigned int vectorSize)
 Computer vectorSize outputs and return them in vector.

virtual StkFramestick (StkFrames &frames, unsigned int channel=1)
 Fill a channel of the StkFrames object with computed outputs.

virtual void controlChange (int number, StkFloat value)=0
 Perform the control change specified by number and value (0.0 - 128.0).


Constructor & Destructor Documentation

Modal::Modal unsigned int  modes = 4  ) 
 

Class constructor, taking the desired number of modes to create.

An StkError will be thrown if the rawwave path is incorrectly set.


Member Function Documentation

virtual StkFrames& Modal::tick StkFrames frames,
unsigned int  channel = 1
[virtual]
 

Fill a channel of the StkFrames object with computed outputs.

The channel argument should be one or greater (the first channel is specified by 1). An StkError will be thrown if the channel argument is zero or it is greater than the number of channels in the StkFrames object.

Reimplemented from Instrmnt.


The documentation for this class was generated from the following file:
The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.