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

#include <mixer.hh>

+ Inheritance diagram for yase::Mixer:
+ Collaboration diagram for yase::Mixer:

Detailed Description

A mixer.

Take n input signals and output the wieghted sum of the signals using the "gain_*" inputs.

Parameters
[in]signal_iThe ith signal
[in]gain_iThe ith gain
[out]signalThe output

Public Member Functions

 Mixer (int n)
 Construct a new mixer.
 
void init ()
 
void update ()
 
int amplitude_index (int i)
 
void set_amplitude_input (int i, double value)
 
double get_amplitude_input (int i)
 
void extend ()
 
int size ()
 
- 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 ()
 

Constructor & Destructor Documentation

◆ Mixer()

yase::Mixer::Mixer ( int  n)

Construct a new mixer.

Parameters
nThe number of signals to mix

Member Function Documentation

◆ get_amplitude_input()

double yase::Mixer::get_amplitude_input ( int  i)

The integer index of the gain input for the signal input i. If there are n inputs to the module, then "gain_i" is signal number n+i.

Parameters
iThe index of the input

◆ init()

void yase::Mixer::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.

◆ set_amplitude_input()

void yase::Mixer::set_amplitude_input ( int  i,
double  value 
)

Set the gain of input i to value. This method is faster than set_input("gain_i"), which should only be used during setup.

Parameters
iThe index of the input
valueThe value to set the gain to

◆ update()

void yase::Mixer::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: