Language Guide / Plugin Architecture
Effect
klang::Effect
Base class for mono audio effects.
An effect receives the current sample in in and writes the processed sample to out. Override the per-sample process() for ordinary DSP. The buffer overload lets you work directly with a block when the algorithm needs it.
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 ยท Apply gain
struct Gain : Effect {
void process() {
in * 0.5 >> out;
}
};
See also Stereo::Effect.
Effect mini-plugin (mono)
More...
#include <klang.h>
|
| template<typename DERIVED , typename... ARGS> |
| static DERIVED * | Create (ARGS &&... args) |
| |
Definition at line 5535 of file klang.h.
◆ ~Effect()
| virtual klang::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::Effect::prepare |
( |
| ) |
|
|
inlinevirtual |
◆ preset()
| virtual event klang::Controller::preset |
( |
int | index | ) |
|
|
inlineprotectedvirtualinherited |
◆ process() [1/2]
| virtual void klang::Effect::process |
( |
| ) |
|
|
inlinevirtual |
◆ process() [2/2]
| virtual void klang::Effect::process |
( |
buffer | buffer | ) |
|
|
inlinevirtual |
◆ reset()
◆ controls
◆ in
◆ out
◆ presets