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

#include <mix.hh>

+ Inheritance diagram for yase::Mix:
+ Collaboration diagram for yase::Mix:

Detailed Description

A stereo mixer and Container.

This class provides a more convenient way to mix a number of signals together to produce a left and right output that can be sent to an Audio module. Since a Mix module is also a Container, you can use add(..) and connect(...) and all the other methods one might need to construct a complex example.

Parameters
[out]leftThe left signal
[out]rightThe right signal

Public Member Functions

 Mix (std::vector< std::tuple< Module &, string, double, double > > connections)
 
void init ()
 
void update ()
 
- Public Member Functions inherited from yase::Container
void init ()
 
void update ()
 
Containeradd (Module &module)
 
Containeradd_if_new (Module &module)
 
Containerpropagate_to (EventManager &em)
 
void run (int num_steps)
 
void run_again (int num_steps)
 
void stop ()
 
Containerconnect (Module &source, string output, Module &dest, string input)
 
Containerconnect (Module &source, string output, Module &dest, int input)
 
Containerconnect (AutoLoad &loader, string category, Module &module)
 
Containerconnect (Module &source, Module &dest)
 
Containerpath (Module &a, Module &b, Module &c)
 
Containerpath (Module &a, Module &b, Module &c, Module &d)
 
Containerpath (Module &a, Module &b, Module &c, Module &d, Module &e)
 
Containerdisconnect (Module &source, string output, Module &dest, string input)
 
bool connected (Module *module, string input_name)
 
Containerequate_input (string input, Module &sub_module, string sub_input)
 
Containerattach_inputs (std::vector< std::tuple< string, Module &, string > > attachments)
 
Containerequate_output (string output, Module &sub_module, string sub_output)
 
Containerattach_outputs (std::vector< std::tuple< string, Module &, string > > attachments)
 
Containerset_thread_number (int n)
 EXPERIMENTAL.
 
Containeradd (Module &module, int n)
 EXPERIMENTAL.
 
void run_threaded (int num_steps)
 EXPERIMENTAL.
 
void update_threaded ()
 EXPERIMENTAL.
 
void thread_loop (int i)
 EXPERIMENTAL.
 
- 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 ()
 
- Public Member Functions inherited from yase::EventManager
 EventManager ()
 Make a new event manager.
 
void process_events (vector< Module * > &modules)
 
void respond_to (const Event &event)
 
EventManagerlisten (int event_type, function< void(const Event &)> handler)
 
EventManagerlisten (int event_type, int port, function< void(const Event &)> handler)
 

Constructor & Destructor Documentation

◆ Mix()

yase::Mix::Mix ( std::vector< std::tuple< Module &, string, double, double > >  connections)

Construct a new Mix container.

Parameters
connections– a vector of tuples of the form { module, "signal_name", 1.23, 3.45 } where module is the module to add, "signal_name" is the name of the signal coming out of the module, and the two numbers are the amplitudes for the left and right channels.

Member Function Documentation

◆ init()

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

Reimplemented from yase::Container.

◆ update()

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

Reimplemented from yase::Container.


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