#include <mix.hh>
Inheritance diagram for yase::Mix:
Collaboration diagram for yase::Mix: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.
| [out] | left | The left signal |
| [out] | right | The 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 () |
| Container & | add (Module &module) |
| Container & | add_if_new (Module &module) |
| Container & | propagate_to (EventManager &em) |
| void | run (int num_steps) |
| void | run_again (int num_steps) |
| void | stop () |
| Container & | connect (Module &source, string output, Module &dest, string input) |
| Container & | connect (Module &source, string output, Module &dest, int input) |
| Container & | connect (AutoLoad &loader, string category, Module &module) |
| Container & | connect (Module &source, Module &dest) |
| Container & | path (Module &a, Module &b, Module &c) |
| Container & | path (Module &a, Module &b, Module &c, Module &d) |
| Container & | path (Module &a, Module &b, Module &c, Module &d, Module &e) |
| Container & | disconnect (Module &source, string output, Module &dest, string input) |
| bool | connected (Module *module, string input_name) |
| Container & | equate_input (string input, Module &sub_module, string sub_input) |
| Container & | attach_inputs (std::vector< std::tuple< string, Module &, string > > attachments) |
| Container & | equate_output (string output, Module &sub_module, string sub_output) |
| Container & | attach_outputs (std::vector< std::tuple< string, Module &, string > > attachments) |
| Container & | set_thread_number (int n) |
| EXPERIMENTAL. | |
| Container & | add (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) |
| EventManager & | listen (int event_type, function< void(const Event &)> handler) |
| EventManager & | listen (int event_type, int port, function< void(const Event &)> handler) |
| yase::Mix::Mix | ( | std::vector< std::tuple< Module &, string, double, double > > | connections | ) |
Construct a new Mix container.
| 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. |
|
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.
|
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.