Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


stk::FormSwep Class Reference

STK sweepable formant filter class. More...

#include <FormSwep.h>

Inheritance diagram for stk::FormSwep:
stk::Filter stk::Stk

List of all members.

Public Member Functions

 FormSwep (void)
 Default constructor creates a second-order pass-through filter.
 ~FormSwep ()
 Class destructor.
void ignoreSampleRateChange (bool ignore=true)
 A function to enable/disable the automatic updating of class data when the STK sample rate changes.
void setResonance (StkFloat frequency, StkFloat radius)
 Sets the filter coefficients for a resonance at frequency (in Hz).
void setStates (StkFloat frequency, StkFloat radius, StkFloat gain=1.0)
 Set both the current and target resonance parameters.
void setTargets (StkFloat frequency, StkFloat radius, StkFloat gain=1.0)
 Set target resonance parameters.
void setSweepRate (StkFloat rate)
 Set the sweep rate (between 0.0 - 1.0).
void setSweepTime (StkFloat time)
 Set the sweep rate in terms of a time value in seconds.
StkFloat lastOut (void) const
 Return the last computed output value.
StkFloat tick (StkFloat input)
 Input one sample to the filter and return a reference to one output.
StkFramestick (StkFrames &frames, unsigned int channel=0)
 Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
StkFramestick (StkFrames &iFrames, StkFrames &oFrames, unsigned int iChannel=0, unsigned int oChannel=0)
 Take a channel of the iFrames object as inputs to the filter and write outputs to the oFrames object.

Detailed Description

STK sweepable formant filter class.

This class implements a formant (resonance) which can be "swept" over time from one frequency setting to another. It provides methods for controlling the sweep rate and target frequency.

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


Member Function Documentation

void stk::FormSwep::setResonance ( StkFloat  frequency,
StkFloat  radius 
)

Sets the filter coefficients for a resonance at frequency (in Hz).

This method determines the filter coefficients corresponding to two complex-conjugate poles with the given frequency (in Hz) and radius from the z-plane origin. The filter zeros are placed at z = 1, z = -1, and the coefficients are then normalized to produce a constant unity gain (independent of the filter gain parameter). The resulting filter frequency response has a resonance at the given frequency. The closer the poles are to the unit-circle (radius close to one), the narrower the resulting resonance width.

void stk::FormSwep::setSweepRate ( StkFloat  rate  ) 

Set the sweep rate (between 0.0 - 1.0).

The formant parameters are varied in increments of the sweep rate between their current and target values. A sweep rate of 1.0 will produce an immediate change in resonance parameters from their current values to the target values. A sweep rate of 0.0 will produce no change in resonance parameters.

void stk::FormSwep::setSweepTime ( StkFloat  time  ) 

Set the sweep rate in terms of a time value in seconds.

This method adjusts the sweep rate based on a given time for the formant parameters to reach their target values.

StkFrames & stk::FormSwep::tick ( StkFrames frames,
unsigned int  channel = 0 
) [inline, virtual]

Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.

The StkFrames argument reference is returned. The channel argument must be less than the number of channels in the StkFrames argument (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

Implements stk::Filter.

StkFrames & stk::FormSwep::tick ( StkFrames iFrames,
StkFrames oFrames,
unsigned int  iChannel = 0,
unsigned int  oChannel = 0 
) [inline]

Take a channel of the iFrames object as inputs to the filter and write outputs to the oFrames object.

The iFrames object reference is returned. Each channel argument must be less than the number of channels in the corresponding StkFrames argument (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.


The documentation for this class was generated from the following file:

The Synthesis ToolKit in C++ (STK)
©1995-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.