![]() |
Klang C++ 0.7.15
Language Reference (draft)
|
Language Guide / Plugin Architecture
klang::Sound
Base class for mono sound sources.
Derive from Sound for procedural audio, such as engine sounds, footsteps, or other game sound effects generated in real time. Implement process() to write one sample to out. Keep the objects that retain state, such as oscillators and filters, as members so they persist between samples.
Sound inherits the Plugin interface through Effect. Use controls to expose settings such as engine speed or surface type, and presets to supply named sets of values.
struct Tone : Sound {
Sine sine;
void process() {
sine(220) * 0.1 >> out;
}
};See also Stereo::Sound.
#include <klang.h>
Inheritance diagram for klang::Sound:Public Member Functions | |
| void | process () override |
| virtual void | process (buffer buffer) |
| virtual void | prepare () |
| virtual void | onControl (int index, float value) |
| virtual void | onPreset (int index) |
| virtual void | onMIDI (int status, int byte1, int byte2) |
| operator const signal & () override | |
| operator const signal & () const override | |
| Modifier< signal > & | operator() (params &&... p) |
| virtual const signal & | input () const |
| virtual void | input (const signal &source) |
| virtual void | operator<< (const signal &source) |
| virtual const signal & | output () const |
| TYPE & | operator>> (TYPE &destination) |
| signal | operator+ (TYPE &other) |
| signal | operator* (TYPE &other) |
| signal | operator- (TYPE &other) |
| signal | operator/ (TYPE &other) |
| void | reset () |
Static Public Member Functions | |
| template<typename DERIVED , typename... ARGS> | |
| static DERIVED * | Create (ARGS &&... args) |
Public Attributes | |
| Controls | controls |
| Presets | presets |
| signal | in |
| signal | out |
Sound mini-plugin (mono). Input is available through in, but is silent unless a model explicitly routes it to out or debug.
|
inlineprotectedvirtualinherited |
|
inlinestaticinherited |
|
inlineprotectedvirtualinherited |
Reimplemented in klang::Debug, klang::Delay< SIZE >, klang::Delay< 0 >, klang::Generic::Function< signal, Args... >, klang::Generic::Graph< SIZE >::Series, and klang::Modifiers::Modal.
Definition at line 2955 of file klang.h.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlineprotectedvirtualinherited |
|
inlinevirtualinherited |
Reimplemented in klang::Stereo::Synth, and klang::Synth.
Definition at line 5513 of file klang.h.
|
inlinevirtualinherited |
Reimplemented in klang::Stereo::Synth, and klang::Synth.
Definition at line 5515 of file klang.h.
|
inlinevirtualinherited |
Reimplemented in klang::Stereo::Synth, and klang::Synth.
Definition at line 5514 of file klang.h.
|
inlineoverridevirtualinherited |
|
inlineoverridevirtualinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Reimplemented in klang::Debug.
|
inlineinherited |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlineprotectedvirtualinherited |
|
inlineoverridevirtual |
|
inlinevirtual |
|
inlineinherited |
|
inherited |
Definition at line 2944 of file klang.h.
Referenced by klang::Generic::Graph< SIZE >::Series::input(), klang::Generic::Graph< SIZE >::Series::operator!=(), and klang::Generic::Graph< SIZE >::Series::operator==().
|
inherited |