![]() |
Klang C++ 0.7.15
Language Reference (draft)
|
Language Guide / Signal Flow
klang::param
A numeric DSP parameter.
Use param for stored values such as frequency, gain and delay time. It is also the parameter type for virtual set() overloads. Implement the matching overload so the object’s inline call syntax can configure it.
For audio quantities, use types such as Frequency, dB, and Amplitude to make the units explicit. See Frequency and dB for conversion examples.
struct LevelStage : Modifier {
param gain = 1;
void set(param value) { gain = value; }
void process() { in * gain >> out; }
};A signal used as a control parameter. More...
#include <klang.h>
Inheritance diagram for klang::param:Public Member Functions | |
| param (constant in) | |
| param (const float initial=0.f) | |
| param (const signal &in) | |
| param (signal &in) | |
| param (Control &in) | |
| template<typename SOURCE , std::enable_if_t<!std::is_arithmetic_v< std::decay_t< SOURCE > > &&!std::is_base_of_v< signal, std::decay_t< SOURCE > > &&!std::is_same_v< std::decay_t< SOURCE >, Control > &&std::is_convertible_v< SOURCE &&, const signal & >, int > = 0> | |
| param (SOURCE &&source) | |
| param & | operator+= (const increment &increment) |
| const signal & | operator<< (const signal &input) |
| Feedback operator (prevents further processing of returned value). | |
| signal & | operator>> (signal &destination) const |
| Stream operator (feedforward; allows further processing) | |
| signal & | operator+= (Output &in) |
| Adds processed output of in to signal. | |
| signal & | operator+= (const signal &x) |
| Add (mix) another signal to the signal. | |
| signal & | operator+= (float x) |
| Add the specified amount to the signal. | |
| signal & | operator+= (double x) |
| Add the specified amount to the signal. | |
| signal & | operator+= (int x) |
| Add the specified amount to the signal. | |
| signal & | operator-= (const signal &x) |
| Subtract another signal from the signal. | |
| signal & | operator-= (float x) |
| Subtract the specified amount from the signal. | |
| signal & | operator-= (double x) |
| Subtract the specified amount from the signal. | |
| signal & | operator-= (int x) |
| Subtract the specified amount from the signal. | |
| signal & | operator*= (const signal &x) |
| Multiply (modulate) signal by another signal. | |
| signal & | operator*= (float x) |
| Multiply signal by the specified amount. | |
| signal & | operator*= (double x) |
| Multiply signal by the specified amount. | |
| signal & | operator*= (int x) |
| Multiply signal by the specified amount. | |
| signal & | operator/= (const signal &x) |
| Divide signal by another signal. | |
| signal & | operator/= (float x) |
| Divide signal by the specified amount. | |
| signal & | operator/= (double x) |
| Divide signal by the specified amount. | |
| signal & | operator/= (int x) |
| Divide signal by the specified amount. | |
| signal | operator+ (float x) const |
| Add two signals together. | |
| signal | operator+ (double x) const |
| Return a copy of the signal offset by x. | |
| signal | operator+ (int x) const |
| Return a copy of the signal offset by x. | |
| relative | operator+ () const |
| Returns a copy of the signal to treat as a relative offset (e.g. for phase modulation). | |
| signal | operator- (float x) const |
| Subtract one signal from another. | |
| signal | operator- (double x) const |
| Return a copy of the signal offset by -x. | |
| signal | operator- (int x) const |
| Return a copy of the signal offset by -x. | |
| signal | operator* (float x) const |
| Multiply (modulate) two signals. | |
| signal | operator* (double x) const |
| Return a copy of the signal scaled by x. | |
| signal | operator* (int x) const |
| Return a copy of the signal scaled by x. | |
| signal | operator/ (float x) const |
| Divide one signal by another. | |
| signal | operator/ (double x) const |
| Return a copy of the signal divided by. | |
| signal | operator/ (int x) const |
| Return a copy of the signal divided by x. | |
| signal | operator^ (float x) const |
| Return a copy of the signal raised to the power of x. | |
| signal | operator^ (double x) const |
| Return a copy of the signal raised to the power of x. | |
| signal | operator^ (int x) const |
| Return a copy of the signal raised to the power of x. | |
| operator const float () const | |
| operator float & () | |
| bool | isDenormal () const |
| Check if the signal contains a denormal value. | |
| int | channels () const |
| Returns the number of channels (1 = mono). | |
| relative | relative () const |
| Returns a copy of the signal to treat as a relative offset (e.g. for phase modulation). | |
Public Attributes | |
| float | value |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
Definition at line 1229 of file klang.h.
References klang::signal::value.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 1499 of file klang.h.
References klang::increment::amount, and klang::increment::size.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 1139 of file klang.h.
References klang::signal::value.
Definition at line 1145 of file klang.h.
References klang::signal::value.
|
inlineinherited |
Definition at line 1221 of file klang.h.
References klang::power(), and klang::signal::value.
|
inlineinherited |
Definition at line 1219 of file klang.h.
References klang::power(), and klang::signal::value.
|
inlineinherited |
Definition at line 1223 of file klang.h.
References klang::power(), and klang::signal::value.
|
inlineinherited |
|
inherited |
Definition at line 1124 of file klang.h.
Referenced by klang::Amplitude::Amplitude(), klang::Controls::add(), klang::signal::isDenormal(), klang::Control::normalised(), klang::signal::operator const float(), klang::Control::operator float(), klang::signal::operator float &(), klang::signal::operator*(), klang::signal::operator*(), klang::signal::operator*(), klang::signal::operator*=(), klang::signal::operator*=(), klang::signal::operator*=(), klang::signal::operator*=(), klang::signal::operator+(), klang::signal::operator+(), klang::signal::operator+(), klang::signal::operator+(), klang::signal::operator+=(), klang::signal::operator+=(), klang::signal::operator+=(), klang::signal::operator+=(), klang::signal::operator-(), klang::signal::operator-(), klang::signal::operator-(), klang::signal::operator-=(), klang::signal::operator-=(), klang::signal::operator-=(), klang::signal::operator-=(), klang::signal::operator/(), klang::signal::operator/(), klang::signal::operator/(), klang::signal::operator/=(), klang::signal::operator/=(), klang::signal::operator/=(), klang::signal::operator/=(), klang::signal::operator<<(), klang::signal::operator>>(), klang::signal::operator^(), klang::signal::operator^(), klang::signal::operator^(), klang::signal::relative(), klang::Modifiers::Modal::set(), and klang::Control::setNormalised().