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

Stereo effect mini-plugin. More...

#include <klang.h>

+ Inheritance diagram for klang::Stereo::Effect:

Public Member Functions

virtual ~Effect ()
 
virtual void prepare ()
 
virtual void process ()
 
virtual void process (Stereo::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 3527 of file klang.h.

Constructor & Destructor Documentation

◆ ~Effect()

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

Definition at line 3528 of file klang.h.

3528{ }

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::Stereo::Effect::prepare ( )
inlinevirtual

Definition at line 3530 of file klang.h.

3530{ };

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::Stereo::Effect::process ( )
inlinevirtual

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

Definition at line 3531 of file klang.h.

3531{ out = in; };

Referenced by process().

◆ process() [2/2]

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

Definition at line 3532 of file klang.h.

3532 {
3533 prepare();
3534 while (!buffer.finished()) {
3535 input(buffer);
3536 process();
3537 buffer++ = out;
3538 debug.buffer++;
3539 }
3540 }
static Debug debug
Definition klang.h:2397
static THREAD_LOCAL Buffer buffer
Definition klang.h:2294
virtual void prepare()
Definition klang.h:3530
virtual void process()
Definition klang.h:3531

References klang::Debug::buffer, klang::debug, klang::Stereo::buffer::finished(), klang::Generic::Input< SIGNAL >::input(), klang::buffer::operator++(), klang::Stereo::buffer::operator++(), klang::Stereo::frame::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.