Language Guide / Plugin Architecture
Stereo::Effect
klang::Stereo::Effect
Base class for stereo audio effects.
A stereo effect receives audio in in and writes the processed result to out. Override the per-frame process() for ordinary DSP. The buffer overload gives you direct access to a block.
Use in.l and in.r for the two input samples and write both output channels. Give each channel its own filter or delay when the algorithm needs independent state.
Stereo::Effect derives from Plugin. Use controls to expose settings such as gain or cutoff in Studio, and presets to give users starting points for common settings.
Example ยท Swap channels
struct Swap : Stereo::Effect {
void process() {
in.r >> out.l;
in.l >> out.r;
}
};
See also Effect.
Stereo effect mini-plugin.
More...
#include <klang.h>
|
| template<typename DERIVED , typename... ARGS> |
| static DERIVED * | Create (ARGS &&... args) |
| |
Definition at line 6063 of file klang.h.
◆ ~Effect()
| virtual klang::Stereo::Effect::~Effect |
( |
| ) |
|
|
inlinevirtual |
◆ control()
| virtual event klang::Controller::control |
( |
int | index, |
|
|
float | value ) |
|
inlineprotectedvirtualinherited |
◆ Create()
template<typename DERIVED , typename... ARGS>
| static DERIVED * klang::Plugin::Create |
( |
ARGS &&... | args | ) |
|
|
inlinestaticinherited |
Definition at line 5523 of file klang.h.
5523 {
5524 static_assert(std::is_base_of_v<Plugin, DERIVED>);
5525 DERIVED* p = new DERIVED();
5526 p->controls.set(std::forward<ARGS>(args)...);
5527 return p;
5528 }
◆ input() [1/3]
|
|
inlineprotectedvirtualinherited |
◆ input() [2/3]
◆ input() [3/3]
◆ midi()
| virtual event klang::Controller::midi |
( |
int | status, |
|
|
int | byte1, |
|
|
int | byte2 ) |
|
inlineprotectedvirtualinherited |
◆ onControl()
| virtual void klang::Controller::onControl |
( |
int | index, |
|
|
float | value ) |
|
inlinevirtualinherited |
◆ onMIDI()
| virtual void klang::Controller::onMIDI |
( |
int | status, |
|
|
int | byte1, |
|
|
int | byte2 ) |
|
inlinevirtualinherited |
◆ onPreset()
| virtual void klang::Controller::onPreset |
( |
int | index | ) |
|
|
inlinevirtualinherited |
◆ operator const signal &() [1/2]
|
|
inlineoverridevirtualinherited |
◆ operator const signal &() [2/2]
|
|
inlineoverridevirtualinherited |
◆ operator()()
Definition at line 3098 of file klang.h.
3098 {
3099 set(std::forward<params>(p)...); return *this;
3100 }
◆ operator*()
◆ operator+()
◆ operator-()
◆ operator/()
◆ operator<<()
◆ operator>>()
◆ output()
◆ prepare()
| virtual void klang::Stereo::Effect::prepare |
( |
| ) |
|
|
inlinevirtual |
◆ preset()
| virtual event klang::Controller::preset |
( |
int | index | ) |
|
|
inlineprotectedvirtualinherited |
◆ process() [1/3]
| virtual void klang::Stereo::Effect::process |
( |
| ) |
|
|
inlinevirtual |
◆ process() [2/3]
◆ process() [3/3]
◆ reset()
◆ controls
◆ in
◆ out
◆ presets