![]() |
Klang C++ 0.7.15
Language Reference (draft)
|
Button · Dial · Menu · Meter · ModWheel · PitchBend · Slider · Toggle · abs · acos · acosh · asin · asinh · atan · atan2 · atanh · cbrt · ceil · clamp · clip · copysign · cos · cosh · cube · erf · erfc · exp · exp2 · fdim · floor · fmod · hypot · log · log10 · log1p · log2 · max · min · mod · pow · power · random · remainder · round · sin · sinh · sqr · sqrt · tan · tanh · trunc
Namespaces | |
| namespace | basic |
| namespace | fast |
| namespace | Filters |
| Common audio filters. | |
| namespace | Generators |
| Common audio generators / oscillators. | |
| namespace | Generic |
| Templates supporting common audio functionality. | |
| namespace | interleaved |
| namespace | minimal |
| namespace | Modifiers |
| Common audio modifiers. | |
| namespace | Mono |
| namespace | mono |
| namespace | optimised |
| namespace | Stereo |
| Objects supporting stereo audio functionality. | |
| namespace | variable |
Classes | |
| struct | ADSR |
| Attack-Decay-Sustain-Release Envelope. More... | |
| struct | Amplitude |
| Control parameter (linear amplitude) More... | |
| struct | Array |
| Variable-sized array, pre-allocated to a max. capacity. More... | |
| struct | Bank |
| A parallel bank of multiple audio objects. More... | |
| class | buffer |
| Audio buffer (mono) More... | |
| struct | Console |
| Debug text output. More... | |
| struct | constant |
| Constant scalar (pre-converted to double, float and int). More... | |
| struct | Control |
| UI control / parameter. More... | |
| struct | ControlEntry |
| Construction-time entry: temporary controls are owned; mutable lvalues are borrowed. More... | |
| struct | Controller |
| Base class for UI / MIDI controll. More... | |
| struct | ControlMap |
| Mapped UI control. More... | |
| struct | Controls |
| struct | dB |
| Control parameter (idecibels) More... | |
| struct | Debug |
| The Klang debug interface. More... | |
| struct | Delay |
| Audio delay object (fixed size) More... | |
| struct | Delay< 0 > |
| Audio delay object (resizable) More... | |
| struct | Effect |
| Effect mini-plugin (mono) More... | |
| class | Envelope |
| Envelope object. More... | |
| struct | File |
| struct | Frequency |
| Control parameter (frequency) More... | |
| struct | Function |
| Applies a function to a signal (input-output) More... | |
| struct | Generator |
| Signal generator object (mono) More... | |
| struct | Graph |
| A line graph plotter. More... | |
| struct | Group |
| Optional presentation grouping, independent of value ownership. More... | |
| struct | increment |
| A phase or wavetable increment. More... | |
| struct | Input |
| Audio input object (mono) More... | |
| struct | Matrix |
| Matrix processor. More... | |
| struct | Memory |
| struct | Modifier |
| Signal modifier object (mono input-output) More... | |
| struct | Note |
| Synthesiser note (mono) More... | |
| class | NoteBase |
| Base class for synthesiser notes. More... | |
| struct | Notes |
| Synthesiser note array. More... | |
| struct | Operator |
| FM operator. More... | |
| struct | Oscillator |
| Audio oscillator object (mono output) More... | |
| struct | Output |
| Audio output object (mono) More... | |
| struct | param |
| A signal used as a control parameter. More... | |
| struct | Phase |
| Control parameter (phase) More... | |
| struct | Pitch |
| Control parameter (pitch) More... | |
| struct | Plugin |
| Base class for mini-plugin. More... | |
| struct | Preset |
| Factory preset. More... | |
| struct | Presets |
| Factory presets. More... | |
| struct | relative |
| A signal used as an offset relative to another signal. More... | |
| class | Sample |
| Sample-based signal generator with variable-rate playback. More... | |
| struct | SampleRate |
| Sample rate constants. More... | |
| struct | signal |
| A mono audio signal (equivalent to a float). More... | |
| struct | signals |
| A multi-channel audio signal (e.g. stereo). More... | |
| struct | Sound |
| struct | Synth |
| Synthesiser object (mono) More... | |
| struct | Table |
| Lookup table object. More... | |
| struct | Text |
| String of characters representing text. More... | |
| struct | Version |
| Klang language version (major.minor.build.debug) More... | |
| class | Wavetable |
| Wavetable-based oscillator. More... | |
Typedefs | |
| typedef unsigned char | byte |
| template<typename BASE , typename EXP > | |
| using | power_t = typename std::conditional_t<std::is_integral_v<BASE>, float, BASE> |
| typedef void | event |
| A function that handles an event. | |
| typedef Text< 32 > | Caption |
| A short Text object used to label controls. | |
| using | UnaryFunction = float(float) |
| A stateless unary C/C++ function that maps one float sample to another. | |
| using | Hz = Frequency |
| Frequency in hertz. | |
| typedef Amplitude | Velocity |
| Control parameter (velocity) | |
| typedef Array< float, 128 > | Values |
Enums | |
| enum | Mode { Peak , RMS , Mean } |
| Klang mode identifiers (e.g. averages, level following) More... | |
Functions | |
| template<typename Base , typename Derived > | |
| constexpr bool | is_derived_from () |
| template<typename Head , typename... Tail> | |
| constexpr bool | are_scalars (Head &&head, Tail &&... tail) |
| template<typename BASE , int EXP> | |
| constexpr BASE | poweri (BASE base) |
| template<typename BASE , typename EXP , std::enable_if_t< is_literal< EXP >, bool > > | |
| constexpr power_t< BASE, EXP > | power (BASE base, EXP exp) |
| Raise base to the power exp. | |
| template<typename BASE , typename EXP > | |
| constexpr power_t< BASE, EXP > | power (BASE base, EXP exp) |
| Raise base to the power exp. | |
| template<typename TYPE > | |
| static TYPE | random (const TYPE min, const TYPE max) |
| Generates a random number between min and max. Use an integer types for whole numbers. | |
| static void | random (const unsigned int seed) |
| Set the random seed (to allow repeatable random generation). | |
| template<typename TYPE , std::enable_if_t< std::is_arithmetic_v< TYPE >, int > = 0> | |
| signal & | operator>> (TYPE input, signal &destination) |
| Stream a built-in arithmetic value into a signal, narrowing at the signal boundary. | |
| signal & | operator>> (const constant &input, signal &destination) |
| Stream a Klang constant into a signal. | |
| signal | operator>> (signal input, UnaryFunction &function) |
| Apply an ordinary unary function within a signal-flow expression. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator+ (float x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel offset by x. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator- (float x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel subtracted from x. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator* (float x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel scaled by x. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator/ (float x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel divided into x. | |
| static param & | operator>> (param &from, param &to) |
| float | fast_mod (float x, float y) |
| double | fast_mod (double x, double y) |
| float | fast_mod1 (float x) |
| double | fast_mod1 (double x) |
| float | fast_mod2pi (float x) |
| float | fast_modp (unsigned int x) |
| double | fast_mod2pi (double x) |
| template<int SIZE> | |
| double | fast_modi (double x) |
| signals< 4 > | operator* (const signals< 4 > &in, const Matrix &m) |
| signals< 4 > | operator>> (const signals< 4 > &in, const Matrix &m) |
| static struct klang::SampleRate | fs (44100) |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator+ (const Control &x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel offset by x. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator- (const Control &x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel subtracted from x. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator* (const Control &x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel scaled by x. | |
| template<int CHANNELS = 2> | |
| signals< CHANNELS > | operator/ (const Control &x, const signals< CHANNELS > &y) |
| Return a copy of the signal with each channel divided into x. | |
| IS_SIMPLE_TYPE (Control) | |
| static Control | Dial (const char *name, float min=0.f, float max=1.f, float initial=0.f, Control::Size size=Automatic) |
| static Control | Button (const char *name, Control::Size size=Automatic) |
| static Control | Toggle (const char *name, bool initial=false, Control::Size size=Automatic) |
| static Control | Slider (const char *name, float min=0.f, float max=1.f, float initial=0.f, Control::Size size=Automatic) |
| template<typename... Options> | |
| static Control | Menu (const char *name, const Options... options) |
| template<typename... Options> | |
| static Control | Menu (const char *name, Control::Size size, const Options... options) |
| static Control | Meter (const char *name, float min=0.f, float max=1.f, float initial=0.f, Control::Size size=Automatic) |
| static Control | PitchBend (Control::Size size=Automatic) |
| static Control | ModWheel (Control::Size size=Automatic) |
| template<typename... Args> | |
| Function (float(*)(Args...)) -> Function< Args... > | |
| static GraphPtr & | operator>> (UnaryFunction &function, klang::GraphPtr &graph) |
| template<typename TYPE > | |
| static GraphPtr & | operator>> (TYPE(*function)(TYPE), klang::GraphPtr &graph) |
| static Graph & | operator>> (UnaryFunction &function, Graph &graph) |
| template<typename TYPE > | |
| static Graph & | operator>> (TYPE(*function)(TYPE), Graph &graph) |
| template<typename LEFT , typename RIGHT , std::enable_if_t< std::is_arithmetic_v< LEFT > &&std::is_arithmetic_v< RIGHT >, int > = 0> | |
| auto | mod (LEFT left, RIGHT right) |
| Return the C++ remainder for integers and the floating-point remainder otherwise. | |
| float | truncate (float input) |
| Alias for trunc, including signal-flow use. | |
| template<typename TYPE , std::enable_if_t< std::is_arithmetic_v< TYPE >, int > = 0> | |
| auto | truncate (TYPE input) |
| template<typename... ARGS> | |
| auto | clip (ARGS &&... args) -> decltype(clamp(std::forward< ARGS >(args)...)) |
| Alias clamp as clip for signal-flow terminology. | |
| template<typename TYPE , std::enable_if_t< std::is_arithmetic_v< TYPE >, int > = 0> | |
| TYPE | sqr (TYPE input) |
| Stateless square and cube functions preserve Klang signals in audio expressions. | |
| template<typename TYPE , std::enable_if_t< std::is_arithmetic_v< TYPE >, int > = 0> | |
| TYPE | cube (TYPE input) |
| template<class OSCILLATOR > | |
| const signal & | operator>> (klang::signal modulator, Operator< OSCILLATOR > &carrier) |
| template<typename SOURCE , typename DESTINATION , class = decltype( detail::flow_destination<SOURCE&, DESTINATION>(std::bool_constant< is_derived_from<Input, DESTINATION>() || is_derived_from<Stereo::Input, DESTINATION>()>{}))> | |
| DESTINATION & | operator>> (SOURCE &source, DESTINATION &destination) |
| Feed audio source to destination (with source processing) | |
| template<typename SOURCE , typename DESTINATION , class = decltype( detail::flow_destination<const SOURCE&, DESTINATION>(std::bool_constant< is_derived_from<Input, DESTINATION>() || is_derived_from<Stereo::Input, DESTINATION>()>{}))> | |
| DESTINATION & | operator>> (const SOURCE &source, DESTINATION &destination) |
| Feed audio source to destination (no source processing) | |
Variables | |
| struct klang::Version | version = { 0, 7, 15, KLANG_DEBUG } |
| template<typename T > | |
| constexpr bool | is_literal = std::is_trivially_constructible_v<T> && std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T> |
| constexpr constant | pi = { 3.1415926535897932384626433832795 } |
| The mathematical constant, pi (and it's inverse). | |
| constexpr constant | ln2 = { 0.6931471805599453094172321214581 } |
| The natural logorithm of 2 (and it's inverse). | |
| constexpr constant | root2 = { 1.4142135623730950488016887242097 } |
| The square root of 2 (and it's inverse). | |
| klang::dB | fs |
| const Control::Size | Automatic = { -1, -1, -1, -1 } |
| const Control::Options | NoOptions |
| static THREAD_LOCAL GraphPtr | graph |
| static Debug | debug |
| constexpr Sample::Mode | OneShot = Sample::OneShot |
| constexpr Sample::Mode | Looped = Sample::Looped |
| struct klang::Preset |
| typedef unsigned char klang::byte |
| typedef Text<32> klang::Caption |
| typedef void klang::event |
| using klang::power_t = typename std::conditional_t<std::is_integral_v<BASE>, float, BASE> |
| using klang::UnaryFunction = float(float) |
| typedef Array<float, 128> klang::Values |
| typedef Amplitude klang::Velocity |
| enum klang::Mode |
|
constexpr |
Definition at line 192 of file klang.h.
References are_scalars().
Referenced by are_scalars().
|
inlinestatic |
Definition at line 1967 of file klang.h.
References klang::Control::BUTTON, klang::Text< 32 >::from(), and NoOptions.
|
inline |
|
inline |
|
inlinestatic |
Definition at line 1962 of file klang.h.
References klang::Text< 32 >::from(), NoOptions, and klang::Control::ROTARY.
|
inline |
Definition at line 1537 of file klang.h.
References fast_mod().
|
inline |
Definition at line 1532 of file klang.h.
References fast_mod().
Referenced by fast_mod(), fast_mod(), and klang::Phase::operator%().
|
inline |
Definition at line 1547 of file klang.h.
References fast_mod1().
|
inline |
Definition at line 1542 of file klang.h.
References fast_mod1().
Referenced by fast_mod1(), and fast_mod1().
|
inline |
Definition at line 1564 of file klang.h.
References fast_mod2pi().
|
inline |
Definition at line 1552 of file klang.h.
References fast_mod2pi().
Referenced by klang::fast::cos(), fast_mod2pi(), fast_mod2pi(), and klang::fast::sin().
|
inline |
Definition at line 1571 of file klang.h.
References fast_modi().
Referenced by fast_modi().
|
inline |
Definition at line 1558 of file klang.h.
References fast_modp().
Referenced by klang::fast::cosp(), fast_modp(), and klang::fast::sinp().
|
static |
| klang::Function | ( | float(* | )(Args...) | ) | -> Function< Args... > |
|
constexpr |
Definition at line 187 of file klang.h.
Referenced by operator>>(), and operator>>().
| klang::IS_SIMPLE_TYPE | ( | Control | ) |
|
static |
Definition at line 1983 of file klang.h.
References klang::Array< TYPE, CAPACITY >::add(), Automatic, klang::Text< 32 >::from(), klang::Control::MENU, and klang::Array< TYPE, CAPACITY >::size().
|
static |
Definition at line 1994 of file klang.h.
References klang::Array< TYPE, CAPACITY >::add(), klang::Text< 32 >::from(), klang::Control::MENU, and klang::Array< TYPE, CAPACITY >::size().
|
inlinestatic |
Definition at line 2004 of file klang.h.
References klang::Text< 32 >::from(), klang::Control::METER, and NoOptions.
|
inline |
Definition at line 3881 of file klang.h.
|
inlinestatic |
Definition at line 2014 of file klang.h.
References NoOptions, and klang::Control::WHEEL.
|
inline |
Definition at line 1597 of file klang.h.
References operator*().
|
inline |
Definition at line 1450 of file klang.h.
References operator*().
Referenced by operator*(), operator*(), operator*(), and operator>>().
|
inline |
|
inline |
Definition at line 1446 of file klang.h.
References operator+().
Referenced by operator+(), and operator+().
|
inline |
|
inline |
Definition at line 1448 of file klang.h.
References operator-().
Referenced by operator-(), and operator-().
|
inline |
Definition at line 1924 of file klang.h.
References operator/(), and klang::Control::value.
|
inline |
Definition at line 1452 of file klang.h.
References operator/().
Referenced by operator/(), and operator/().
Definition at line 1262 of file klang.h.
References klang::constant::f.
Definition at line 1604 of file klang.h.
References operator*(), and operator>>().
|
inline |
Definition at line 6283 of file klang.h.
References is_derived_from().
|
inline |
Definition at line 1511 of file klang.h.
References operator>>().
|
inline |
|
inline |
Definition at line 6268 of file klang.h.
References is_derived_from().
|
inline |
Definition at line 1257 of file klang.h.
Referenced by operator>>(), and operator>>().
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 2009 of file klang.h.
References NoOptions, and klang::Control::WHEEL.
|
inlineconstexpr |
Definition at line 216 of file klang.h.
References poweri().
Referenced by klang::Amplitude::Amplitude(), klang::dB::operator->(), klang::Pitch::operator->(), klang::signal::operator^(), klang::signal::operator^(), klang::signal::operator^(), and power().
|
inlineconstexpr |
Definition at line 248 of file klang.h.
References power().
|
inlineconstexpr |
Definition at line 198 of file klang.h.
Referenced by power().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 1977 of file klang.h.
References klang::Text< 32 >::from(), NoOptions, and klang::Control::SLIDER.
|
inline |
|
inlinestatic |
Definition at line 1972 of file klang.h.
References klang::Text< 32 >::from(), NoOptions, and klang::Control::TOGGLE.
|
inline |
|
inline |
| const Control::Size klang::Automatic = { -1, -1, -1, -1 } |
|
static |
Definition at line 4518 of file klang.h.
Referenced by klang::Effect::process(), klang::Note::process(), klang::Stereo::Effect::process(), and klang::Stereo::Effect::process().
| klang::dB klang::fs |
Referenced by klang::Filters::Biquad::Filter::delay(), klang::Filters::IIR< 1 >::delay(), klang::Filters::Biquad::APF::init(), klang::Filters::Butterworth::LPF< 1 >::init(), klang::Filters::OnePole::HPF::init(), klang::Filters::OnePole::LPF::init(), klang::Filters::Biquad::Filter::phase(), klang::Filters::IIR< 1 >::phase(), klang::Filters::OnePole::LPF::phase(), klang::Envelope::Follower::AR::set(), klang::Filters::Biquad::APF::set(), klang::Filters::Biquad::Filter::set(), klang::Generators::Fast::Phasor::set(), klang::Generators::Fast::Sine::set(), klang::Generic::Oscillator< SIGNAL >::set(), and klang::Modifiers::Modal::set().
|
static |
Definition at line 3829 of file klang.h.
Referenced by klang::Generic::Function< SIGNAL, Args >::operator>>(), klang::Generic::Function< SIGNAL, Args >::operator>>(), operator>>(), operator>>(), operator>>(), and operator>>().
|
inlineconstexpr |
|
constexpr |
|
inlineconstexpr |
| const Control::Options klang::NoOptions |
Definition at line 1915 of file klang.h.
Referenced by Button(), Dial(), Meter(), ModWheel(), PitchBend(), Slider(), and Toggle().
|
inlineconstexpr |
|
constexpr |
Definition at line 287 of file klang.h.
Referenced by klang::SampleRate::SampleRate(), klang::fast::cos(), klang::fast::cosp(), klang::Filters::Biquad::Filter::delay(), klang::Filters::IIR< 1 >::delay(), klang::Filters::Biquad::APF::init(), klang::Filters::Butterworth::LPF< 1 >::init(), klang::Phase::operator+=(), klang::Filters::Biquad::Filter::phase(), klang::Filters::IIR< 1 >::phase(), klang::Filters::OnePole::LPF::phase(), klang::Generators::Basic::Pulse::process(), klang::Generators::Basic::Saw::process(), klang::Generators::Basic::Square::process(), klang::Generators::Basic::Triangle::process(), klang::Generic::Oscillator< SIGNAL >::set(), klang::Generic::Oscillator< SIGNAL >::set(), klang::Modifiers::Modal::set(), klang::fast::sin(), and klang::fast::sinp().
|
constexpr |
Definition at line 293 of file klang.h.
Referenced by klang::Filters::Biquad::Filter::set().
| struct klang::Version klang::version = { 0, 7, 15, KLANG_DEBUG } |