Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
klang::Generic::Generator< SIGNAL >abstract

Signal generator object (output only) More...

#include <klang.h>

+ Inheritance diagram for klang::Generic::Generator< SIGNAL >:

Public Member Functions

template<typename... params>
Output< SIGNAL > & operator() (params &&... p)
 
 operator const SIGNAL & () override
 
 operator const SIGNAL & () const override
 
virtual const SIGNAL & output () const
 
template<typename TYPE , class = decltype( std::declval<TYPE&>() = std::declval<SIGNAL&>())>
TYPE & operator>> (TYPE &destination)
 
template<typename TYPE >
SIGNAL operator+ (TYPE &other)
 
template<typename TYPE >
SIGNAL operator* (TYPE &other)
 
template<typename TYPE >
SIGNAL operator- (TYPE &other)
 
template<typename TYPE >
SIGNAL operator/ (TYPE &other)
 
void reset ()
 

Public Attributes

SIGNAL out = { 0.f }
 

Detailed Description

template<typename SIGNAL>
struct klang::Generic::Generator< SIGNAL >

Definition at line 3045 of file klang.h.

Member Function Documentation

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

template<typename SIGNAL >
klang::Generic::Generator< SIGNAL >::operator const SIGNAL & ( ) const
inlineoverridevirtual

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

Definition at line 3057 of file klang.h.

3057{ return out; } // return last output

References klang::Generic::Output< SIGNAL >::out.

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

template<typename SIGNAL >
klang::Generic::Generator< SIGNAL >::operator const SIGNAL & ( )
inlineoverridevirtual

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

Definition at line 3056 of file klang.h.

3056{ this->process(); return out; } // return processed output
virtual void process()=0

References klang::Generic::Output< SIGNAL >::out, and klang::Generic::Output< SIGNAL >::process().

◆ operator()()

template<typename SIGNAL >
template<typename... params>
Output< SIGNAL > & klang::Generic::Generator< SIGNAL >::operator() ( params &&... p)
inline

Definition at line 3050 of file klang.h.

3050 {
3051 set(std::forward<params>(p)...); return *this;
3052 }

◆ operator*()

template<typename SIGNAL >
template<typename TYPE >
SIGNAL klang::Generic::Output< SIGNAL >::operator* ( TYPE & other)
inlineinherited

Definition at line 2977 of file klang.h.

2977{ this->process(); return out * SIGNAL(other); }

References klang::Generic::Output< SIGNAL >::process().

◆ operator+()

template<typename SIGNAL >
template<typename TYPE >
SIGNAL klang::Generic::Output< SIGNAL >::operator+ ( TYPE & other)
inlineinherited

Definition at line 2976 of file klang.h.

2976{ this->process(); return out + SIGNAL(other); }

References klang::Generic::Output< SIGNAL >::process().

◆ operator-()

template<typename SIGNAL >
template<typename TYPE >
SIGNAL klang::Generic::Output< SIGNAL >::operator- ( TYPE & other)
inlineinherited

Definition at line 2978 of file klang.h.

2978{ this->process(); return out - SIGNAL(other); }

References klang::Generic::Output< SIGNAL >::process().

◆ operator/()

template<typename SIGNAL >
template<typename TYPE >
SIGNAL klang::Generic::Output< SIGNAL >::operator/ ( TYPE & other)
inlineinherited

Definition at line 2979 of file klang.h.

2979{ this->process(); return out / SIGNAL(other); }

References klang::Generic::Output< SIGNAL >::process().

◆ operator>>()

template<typename SIGNAL >
template<typename TYPE , class = decltype( std::declval<TYPE&>() = std::declval<SIGNAL&>())>
TYPE & klang::Generic::Output< SIGNAL >::operator>> ( TYPE & destination)
inlineinherited

Definition at line 2969 of file klang.h.

2969{ this->process(); return destination = out; }

References klang::Generic::Output< SIGNAL >::out, and klang::Generic::Output< SIGNAL >::process().

◆ output()

template<typename SIGNAL >
virtual const SIGNAL & klang::Generic::Output< SIGNAL >::output ( ) const
inlinevirtualinherited

Definition at line 2964 of file klang.h.

2964{ return out; }

References klang::Generic::Output< SIGNAL >::out.

◆ process()

template<typename SIGNAL >
virtual void klang::Generic::Output< SIGNAL >::process ( )
protectedpure virtualinherited

Implemented in klang::Delay< SIZE >, klang::Delay< 0 >, klang::Effect, klang::Envelope::Follower::AR, klang::Envelope::Follower, klang::Envelope::Follower::Window< WINDOW >, klang::Envelope, klang::Envelope::Ramp, klang::Filters::Biquad::Filter, klang::Filters::Butterworth::LPF< 1 >, klang::Filters::DCF, klang::Filters::IIR< ORDER >, klang::Filters::IIR< 1 >, klang::Filters::OnePole::Filter, klang::Filters::OnePole::LPF, klang::Generators::Basic::Noise, klang::Generators::Basic::Phasor, klang::Generators::Basic::Pulse, klang::Generators::Basic::Saw, klang::Generators::Basic::Sine, klang::Generators::Basic::Square, klang::Generators::Basic::Triangle, klang::Generators::Fast::Noise, klang::Generators::Fast::Phasor, klang::Generators::Fast::Sine, klang::Generic::Function< SIGNAL, Args >, klang::Generic::Function< signal, Args... >, klang::Generic::Modifier< SIGNAL >, klang::Generic::Modifier< signal >, klang::Modifiers::Modal, klang::Note, klang::Sample, klang::Sound, klang::Stereo::Effect, klang::Stereo::Mono::Note, klang::Stereo::Note, klang::Stereo::Sound, klang::Stereo::Synth, klang::Synth, and klang::Wavetable.

Referenced by klang::Generic::Generator< SIGNAL >::operator const SIGNAL &(), klang::Generic::Output< SIGNAL >::operator const SIGNAL &(), klang::Generic::Output< SIGNAL >::operator*(), klang::Generic::Output< SIGNAL >::operator+(), klang::Generic::Output< SIGNAL >::operator-(), klang::Generic::Output< SIGNAL >::operator/(), and klang::Generic::Output< SIGNAL >::operator>>().

◆ reset()

template<typename SIGNAL >
void klang::Generic::Output< SIGNAL >::reset ( )
inlineinherited

Definition at line 2981 of file klang.h.

2981{ out = 0; }

References klang::Generic::Output< SIGNAL >::out.

Member Data Documentation

◆ out