![]() |
Klang C++
Language Reference (draft)
|
Namespaces | |
| namespace | basic |
| namespace | Filters |
| Common audio filters. | |
| namespace | Generators |
| Common audio generators / oscillators. | |
| namespace | Generic |
| Templates supporting common audio functionality. | |
| namespace | minimal |
| namespace | Mono |
| namespace | mono |
| namespace | optimised |
| namespace | Stereo |
| Objects supporting stereo audio functionality. | |
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 | Controller |
| Base class for UI / MIDI controll. More... | |
| struct | ControlMap |
| Mapped UI control. More... | |
| struct | Controls |
| Plugin UI controls. More... | |
| struct | dB |
| Control parameter (idecibels) More... | |
| struct | Debug |
| The Klang debug interface. More... | |
| struct | Delay |
| Audio delay object. More... | |
| struct | Effect |
| Effect mini-plugin (mono) More... | |
| class | Envelope |
| Envelope object. More... | |
| 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 | increment |
| A phase or wavetable increment. More... | |
| struct | Input |
| Audio input object (mono) More... | |
| struct | Matrix |
| Matrix processor. More... | |
| 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... | |
| 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 | 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 | |
| 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. | |
| 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 TYPE1 , typename TYPE2 > | |
| TYPE1 | min (TYPE1 a, TYPE2 b) |
| Return the minimum of two values. | |
| template<typename TYPE1 , typename TYPE2 > | |
| TYPE1 | max (TYPE1 a, TYPE2 b) |
| Return the minimum of two values. | |
| 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). | |
| static signal & | operator>> (float input, signal &destination) |
| Stream a literal / constant / scalar type into a signal. | |
| 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) |
| IS_SIMPLE_TYPE (Control) | |
| static Control | Dial (const char *name, float min=0.f, float max=1.f, float initial=0.f) |
| static Control | Button (const char *name) |
| static Control | Toggle (const char *name, bool initial=false) |
| static Control | Slider (const char *name, float min=0.f, float max=1.f, float initial=0.f) |
| template<typename... Options> | |
| static Control | Menu (const char *name, const Options... options) |
| static Control | Meter (const char *name, float min=0.f, float max=1.f, float initial=0.f) |
| static Control | PitchBend () |
| static Control | ModWheel () |
| template<typename... Args> | |
| Function (float(*)(Args...)) -> Function< Args... > | |
| template<typename TYPE > | |
| static GraphPtr & | operator>> (TYPE(*function)(TYPE), klang::GraphPtr &graph) |
| template<typename TYPE > | |
| static Graph & | operator>> (TYPE(*function)(TYPE), Graph &graph) |
| static Function< float > | sqrt (SQRTF) |
| Square root function (audio object) | |
| static Function< float > | abs (FABS) |
| Absolute/rectify function (audio object) | |
| static Function< float > | sqr ([](float x) -> float { return x *x;}) |
| Square function (audio object) | |
| static Function< float > | cube ([](float x) -> float { return x *x *x;}) |
| Cube function (audio object) | |
| template<class OSCILLATOR > | |
| const signal & | operator>> (klang::signal modulator, Operator< OSCILLATOR > &carrier) |
| template<typename SOURCE , typename DESTINATION > | |
| DESTINATION & | operator>> (SOURCE &source, DESTINATION &destination) |
| Feed audio source to destination (with source processing) | |
| template<typename SOURCE , typename DESTINATION > | |
| DESTINATION & | operator>> (const SOURCE &source, DESTINATION &destination) |
| Feed audio source to destination (no source processing) | |
Variables | |
| struct klang::Version | version = { 0, 7, 0, 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 |
| struct klang::Preset |
| typedef Text<32> klang::Caption |
| typedef void klang::event |
| using klang::power_t = typename std::conditional_t<std::is_integral_v<BASE>, float, BASE> |
| typedef Array<float, 128> klang::Values |
| typedef Amplitude klang::Velocity |
| enum klang::Mode |
|
inlinestatic |
|
constexpr |
Definition at line 126 of file klang.h.
|
inlinestatic |
Definition at line 1066 of file klang.h.
References Automatic, klang::Control::BUTTON, klang::Text< SIZE >::from(), and NoOptions.
|
inlinestatic |
|
inlinestatic |
Definition at line 1063 of file klang.h.
References Automatic, klang::Text< SIZE >::from(), NoOptions, and klang::Control::ROTARY.
|
inline |
|
inline |
Definition at line 697 of file klang.h.
Referenced by klang::Phase::operator%().
|
inline |
|
inline |
|
inline |
Definition at line 729 of file klang.h.
|
inline |
Definition at line 717 of file klang.h.
Referenced by klang::Generators::Fast::fastsin().
|
inline |
Definition at line 736 of file klang.h.
|
inline |
Definition at line 723 of file klang.h.
Referenced by klang::Generators::Fast::fastsinp().
|
static |
| klang::Function | ( | float(* | )(Args...) | ) | -> Function< Args... > |
|
constexpr |
| klang::IS_SIMPLE_TYPE | ( | Control | ) |
|
inline |
|
static |
Definition at line 1076 of file klang.h.
|
inlinestatic |
Definition at line 1085 of file klang.h.
References Automatic, klang::Text< SIZE >::from(), klang::Control::METER, and NoOptions.
|
inline |
|
inlinestatic |
Definition at line 1091 of file klang.h.
References Automatic, NoOptions, and klang::Control::WHEEL.
Definition at line 762 of file klang.h.
References klang::Matrix::operator[](), and klang::signals< CHANNELS >::operator[]().
Referenced by operator>>().
|
inline |
Definition at line 623 of file klang.h.
Definition at line 769 of file klang.h.
References operator*().
|
inline |
Definition at line 3613 of file klang.h.
Referenced by klang::Envelope::Follower::rms().
Definition at line 495 of file klang.h.
References klang::signal::signal().
|
inline |
|
inline |
Definition at line 3601 of file klang.h.
Referenced by klang::Envelope::Follower::peak(), and klang::Envelope::Follower::rms().
|
static |
|
static |
|
inlinestatic |
Definition at line 1088 of file klang.h.
References Automatic, NoOptions, and klang::Control::WHEEL.
|
inlineconstexpr |
Definition at line 150 of file klang.h.
|
inlineconstexpr |
Definition at line 181 of file klang.h.
Referenced by klang::Amplitude::Amplitude(), klang::dB::operator->(), klang::Pitch::operator->(), klang::signal::operator^(), klang::signal::operator^(), and klang::signal::operator^().
|
inlineconstexpr |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 1072 of file klang.h.
References Automatic, klang::Text< SIZE >::from(), NoOptions, and klang::Control::SLIDER.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 1069 of file klang.h.
References Automatic, klang::Text< SIZE >::from(), NoOptions, and klang::Control::TOGGLE.
| const Control::Size klang::Automatic = { -1, -1, -1, -1 } |
Definition at line 1038 of file klang.h.
Referenced by Button(), Dial(), Meter(), ModWheel(), PitchBend(), Slider(), and Toggle().
|
static |
Definition at line 2397 of file klang.h.
Referenced by klang::Effect::process(), klang::Note::process(), and klang::Stereo::Effect::process().
| klang::dB klang::fs |
|
inlineconstexpr |
|
constexpr |
| const Control::Options klang::NoOptions |
Definition at line 1039 of file klang.h.
Referenced by Button(), Dial(), Meter(), ModWheel(), PitchBend(), Slider(), and Toggle().
|
constexpr |
Definition at line 218 of file klang.h.
Referenced by klang::SampleRate::SampleRate(), klang::Generators::Fast::fastsin(), klang::Generators::Fast::fastsinp(), klang::Filters::Butterworth::LPF::init(), klang::Generators::Fast::Phase::operator+(), klang::Phase::operator+=(), klang::Generators::Fast::Phase::operator=(), 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(), and klang::Generators::Fast::OSM::setDuty().
|
constexpr |
| struct klang::Version klang::version = { 0, 7, 0, KLANG_DEBUG } |