Klang C++
Language Reference (draft)
Loading...
Searching...
No Matches
klang::Effect

Effect mini-plugin (mono) More...

#include <klang.h>

+ Inheritance diagram for klang::Effect:

Public Member Functions

virtual ~Effect ()
 
virtual void prepare ()
 
virtual void process ()
 
virtual void process (buffer buffer)
 
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 signalinput () const
 
virtual void input (const signal &source)
 
virtual void operator<< (const signal &source)
 
virtual const signaloutput () const
 
TYPE & operator>> (TYPE &destination)
 
signal operator+ (TYPE &other)
 
signal operator* (TYPE &other)
 
signal operator- (TYPE &other)
 
signal operator/ (TYPE &other)
 

Public Attributes

Controls controls
 
Presets presets
 
signal in
 
signal out
 

Detailed Description

Definition at line 3086 of file klang.h.

Constructor & Destructor Documentation

◆ ~Effect()

virtual klang::Effect::~Effect ( )
inlinevirtual

Definition at line 3087 of file klang.h.

3087{ }

Member Function Documentation

◆ control()

virtual event klang::Controller::control ( int index,
float value )
inlineprotectedvirtualinherited

Definition at line 3068 of file klang.h.

3068{ };

Referenced by klang::Controller::onControl(), and klang::Synth::onControl().

◆ input() [1/3]

virtual void klang::Generic::Input< signal >::input ( )
inlineprotectedvirtualinherited

◆ input() [2/3]

virtual const signal & klang::Generic::Input< signal >::input ( ) const
inlinevirtualinherited

Reimplemented in klang::Generic::Graph< SIZE >::Series.

Definition at line 1343 of file klang.h.

1343{ return in; }

◆ input() [3/3]

virtual void klang::Generic::Input< signal >::input ( const signal & source)
inlinevirtualinherited

Definition at line 1347 of file klang.h.

1347{ in = source; input(); }
virtual const signal & input() const
Definition klang.h:1343

◆ midi()

virtual event klang::Controller::midi ( int status,
int byte1,
int byte2 )
inlineprotectedvirtualinherited

Definition at line 3070 of file klang.h.

3070{ };

Referenced by klang::NoteBase< SYNTH >::controlChange(), and klang::Controller::onMIDI().

◆ onControl()

virtual void klang::Controller::onControl ( int index,
float value )
inlinevirtualinherited

Reimplemented in klang::Synth.

Definition at line 3072 of file klang.h.

3072{ control(index, value); };
virtual event control(int index, float value)
Definition klang.h:3068

References klang::Controller::control().

Referenced by klang::Synth::onControl().

◆ onMIDI()

virtual void klang::Controller::onMIDI ( int status,
int byte1,
int byte2 )
inlinevirtualinherited

Definition at line 3074 of file klang.h.

3074{ midi(status, byte1, byte2); }
virtual event midi(int status, int byte1, int byte2)
Definition klang.h:3070

References klang::Controller::midi().

◆ onPreset()

virtual void klang::Controller::onPreset ( int index)
inlinevirtualinherited

Reimplemented in klang::Synth.

Definition at line 3073 of file klang.h.

3073{ preset(index); };
virtual event preset(int index)
Definition klang.h:3069

References klang::Controller::preset().

Referenced by klang::Synth::onPreset().

◆ operator const signal &() [1/2]

klang::Generic::Modifier< signal >::operator const signal & ( ) const
inlineoverridevirtualinherited

Reimplemented from klang::Generic::Output< signal >.

Definition at line 1450 of file klang.h.

1450{ return out; } // return last output

◆ operator const signal &() [2/2]

klang::Generic::Modifier< signal >::operator const signal & ( )
inlineoverridevirtualinherited

Reimplemented from klang::Generic::Output< signal >.

Definition at line 1449 of file klang.h.

1449{ process(); return out; } // return processed output
virtual void process() override
Definition klang.h:1453

◆ operator()()

Modifier< signal > & klang::Generic::Modifier< signal >::operator() ( params... p)
inlineinherited

Definition at line 1457 of file klang.h.

1457 {
1458 set(p...); return *this;
1459 }

◆ operator*()

signal klang::Generic::Output< signal >::operator* ( TYPE & other)
inlineinherited

Definition at line 1372 of file klang.h.

1372{ process(); return out * (other); }

◆ operator+()

signal klang::Generic::Output< signal >::operator+ ( TYPE & other)
inlineinherited

Definition at line 1371 of file klang.h.

1371{ process(); return out + (other); }

◆ operator-()

signal klang::Generic::Output< signal >::operator- ( TYPE & other)
inlineinherited

Definition at line 1373 of file klang.h.

1373{ process(); return out - (other); }

◆ operator/()

signal klang::Generic::Output< signal >::operator/ ( TYPE & other)
inlineinherited

Definition at line 1374 of file klang.h.

1374{ process(); return out / (other); }

◆ operator<<()

virtual void klang::Generic::Input< signal >::operator<< ( const signal & source)
inlinevirtualinherited

Definition at line 1346 of file klang.h.

1346{ in = source; input(); }

◆ operator>>()

TYPE & klang::Generic::Output< signal >::operator>> ( TYPE & destination)
inlineinherited

Definition at line 1364 of file klang.h.

1364{ process(); return destination = out; }

◆ output()

virtual const signal & klang::Generic::Output< signal >::output ( ) const
inlinevirtualinherited

Definition at line 1360 of file klang.h.

1360{ return out; }

◆ prepare()

virtual void klang::Effect::prepare ( )
inlinevirtual

Definition at line 3089 of file klang.h.

3089{ };

Referenced by process().

◆ preset()

virtual event klang::Controller::preset ( int index)
inlineprotectedvirtualinherited

Definition at line 3069 of file klang.h.

3069{ };

Referenced by klang::Controller::onPreset(), and klang::Synth::onPreset().

◆ process() [1/2]

virtual void klang::Effect::process ( )
inlinevirtual

Reimplemented from klang::Generic::Modifier< signal >.

Definition at line 3090 of file klang.h.

3090{ out = in; }

Referenced by process().

◆ process() [2/2]

virtual void klang::Effect::process ( buffer buffer)
inlinevirtual

Definition at line 3091 of file klang.h.

3091 {
3092 prepare();
3093 while (!buffer.finished()) {
3094 input(buffer);
3095 process();
3096 buffer++ = out;
3097 debug.buffer++;
3098 }
3099 }
static Debug debug
Definition klang.h:2397
static THREAD_LOCAL Buffer buffer
Definition klang.h:2294
virtual void prepare()
Definition klang.h:3089
virtual void process()
Definition klang.h:3090

References klang::Debug::buffer, klang::debug, klang::buffer::finished(), klang::Generic::Input< SIGNAL >::input(), klang::buffer::operator++(), prepare(), and process().

Member Data Documentation

◆ controls

Controls klang::Plugin::controls
inherited

Definition at line 3081 of file klang.h.

◆ in

Definition at line 1340 of file klang.h.

1340{ 0.f };

◆ out

Definition at line 1357 of file klang.h.

1357{ 0.f };

◆ presets

Presets klang::Plugin::presets
inherited

Definition at line 3082 of file klang.h.