Yet Another Synthesizer Engine
 
Loading...
Searching...
No Matches
yase::Biquad Class Reference

#include <biquad.hh>

+ Inheritance diagram for yase::Biquad:
+ Collaboration diagram for yase::Biquad:

Detailed Description

Standard Biquad filters adapated from https://www.w3.org/TR/audio-eq-cookbook/.

Parameters
[in]signal
[in]frequency
[in]resonance
[out]signal

Public Member Functions

void init ()
 
void update ()
 
void on ()
 Turn the filter on.
 
void off ()
 
bool toggle ()
 Turn the filter on if it is off and off if it is on.
 
void set_type (std::string name)
 
void recalculate ()
 
- Public Member Functions inherited from yase::IIRFilter
 IIRFilter (int P, int Q)
 
 IIRFilter (vector< double > A, vector< double > B)
 
void init ()
 
void update ()
 
void set_coefficients (vector< double > A, vector< double > B)
 
- Public Member Functions inherited from yase::Module
virtual void init ()=0
 
virtual void update ()=0
 
int add_input (string name)
 
int add_output (string name)
 
int get_input_index (string name) const
 
string get_input_name (int index) const
 
string get_output_name (int index) const
 
int get_output_index (string name) const
 
void set_input (string name, double value)
 
void set_input (int index, double value)
 
double get_input (int index) const
 
double get_input (string name) const
 
double get_output (string name) const
 
double get_output (int index) const
 
void set_output (int index, double value)
 
void copy_inputs (const Module &source)
 
void copy_outputs (Module &destination) const
 
void configure (std::vector< std::tuple< string, double > > assignments)
 
int num_inputs () const
 
int num_outputs () const
 
void emit (Event e)
 
void set_ts (double s)
 
double get_ts ()
 

Member Function Documentation

◆ init()

void yase::Biquad::init ( )
virtual

This method should be overridden by derived classes. It will usually be called once, after all modules and connections objects have been added to a synthesizer, but before the synthesizer starts running.

Implements yase::Module.

◆ off()

void yase::Biquad::off ( )

Turn the filter off. In it's off state, the input signal is routed directly to the output signal.

◆ recalculate()

void yase::Biquad::recalculate ( )

Recalculate the coefficients of the filter. Generally this is done automatically when the frequency or resonance input changes.

◆ set_type()

void yase::Biquad::set_type ( std::string  name)

Set the type of the filter to be either low pass, high pass, all pass, or band pass.

Parameters
nameEither "lpf", "hpf", "apf", or "bpf"

◆ update()

void yase::Biquad::update ( )
virtual

This method should be overridden by derived classes. It will be called repeatedly by a synthesizer at a frequency determined by SAMPLE_RATE.

Implements yase::Module.


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