Mozzi  alpha 0.01.1t
sound synthesis library for Arduino
 All Classes Functions Typedefs
Public Member Functions
StateVariable< FILTER_TYPE > Class Template Reference

A State Variable filter which offers 12db resonant low, high, bandpass and notch modes. More...

List of all members.

Public Member Functions

 StateVariable ()
 Constructor.
void setResonance (Q0n8 resonance)
 Set how resonant the filter will be.
void setCentreFreq (unsigned int centre_freq)
 Set the centre or corner frequency of the filter.
int next (int input)
 Calculate the next sample, given an input signal.

Detailed Description

template<char FILTER_TYPE>
class StateVariable< FILTER_TYPE >

A State Variable filter which offers 12db resonant low, high, bandpass and notch modes.

Template Parameters:
FILTER_TYPEchoose between LOWPASS, BANDPASS, HIGHPASS and NOTCH.
Note:
To save processing time, this version of the filter does not saturate internally, so any resonant peaks are unceremoniously truncated. It may be worth adding code to constrain the internal variables to enable resonant saturating effects.
Todo:
Try adding code to constrain the internal variables to enable resonant saturating effects.

Definition at line 54 of file StateVariable.h.


Member Function Documentation

template<char FILTER_TYPE>
int StateVariable< FILTER_TYPE >::next ( int  input) [inline]

Calculate the next sample, given an input signal.

Parameters:
inputthe signal input.
Returns:
the signal output.
Note:
Timing: 16 - 20 us

Definition at line 120 of file StateVariable.h.

template<char FILTER_TYPE>
void StateVariable< FILTER_TYPE >::setCentreFreq ( unsigned int  centre_freq) [inline]

Set the centre or corner frequency of the filter.

Parameters:
centre_freq20 - 4096 Hz (AUDIO_RATE/4). This will be the cut-off frequency for LOWPASS and HIGHPASS, and the centre frequency to pass or reduce for BANDPASS and NOTCH.
Note:
Timing 25-30us

Definition at line 103 of file StateVariable.h.

template<char FILTER_TYPE>
void StateVariable< FILTER_TYPE >::setResonance ( Q0n8  resonance) [inline]

Set how resonant the filter will be.

Parameters:
resonancea byte value between 1 and 255. The lower this value is, the more resonant the filter. At very low values, the filter can output loud peaks which can exceed Mozzi's output range, so you may need to attenuate the output in your sketch.
Note:
Timing < 500 ns

Definition at line 75 of file StateVariable.h.


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