DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::CharacterStage< T > Class Template Reference

Emphasis, static saturators and de-emphasis, with drift, sag and noise. More...

#include <CharacterStage.h>

Classes

struct  Settings
 The settings of the stage. More...
 

Public Member Functions

void prepare (const AudioSpec &spec)
 Allocates the oversampler and the scratch, and clears the state.
 
void reset () noexcept
 Clears every memory and restarts the random sources. Audio thread.
 
void setSettings (const Settings &s) noexcept
 Sets every setting at once (clamped; non-finite fields are ignored). Any thread.
 
Settings settings () const noexcept
 
int getLatency () const noexcept
 
int getFactor () const noexcept
 
void process (AudioBufferView< T > buffer) noexcept
 Colours a block in place.
 

Static Public Attributes

static constexpr int kMaxChannels = 16
 

Detailed Description

template<FloatType T>
class dspark::CharacterStage< T >

Emphasis, static saturators and de-emphasis, with drift, sag and noise.

Template Parameters
TSample type (float or double); the arithmetic runs in double.

Definition at line 78 of file CharacterStage.h.

Member Function Documentation

◆ getFactor()

template<FloatType T>
int dspark::CharacterStage< T >::getFactor ( ) const
inlinenoexcept
Returns
The internal rate's factor over the host rate (1 before prepare()).

Definition at line 174 of file CharacterStage.h.

◆ getLatency()

template<FloatType T>
int dspark::CharacterStage< T >::getLatency ( ) const
inlinenoexcept
Returns
The delay of the stage in host samples (the oversampler's, rounded at low frequencies).

Definition at line 171 of file CharacterStage.h.

◆ prepare()

template<FloatType T>
void dspark::CharacterStage< T >::prepare ( const AudioSpec &  spec)
inline

Allocates the oversampler and the scratch, and clears the state.

An invalid spec is a no-op that keeps the previous state.

Parameters
specHost rate, largest block and channel count.

Definition at line 101 of file CharacterStage.h.

◆ process()

template<FloatType T>
void dspark::CharacterStage< T >::process ( AudioBufferView< T >  buffer)
inlinenoexcept

Colours a block in place.

Channels beyond those prepared (or beyond 16) are left untouched, as is the whole block before prepare(). Blocks longer than the prepared size run in pieces. Non-finite samples read as silence.

Parameters
bufferAudio to colour.

Definition at line 185 of file CharacterStage.h.

◆ reset()

template<FloatType T>
void dspark::CharacterStage< T >::reset ( )
inlinenoexcept

Clears every memory and restarts the random sources. Audio thread.

Definition at line 135 of file CharacterStage.h.

◆ setSettings()

template<FloatType T>
void dspark::CharacterStage< T >::setSettings ( const Settings &  s)
inlinenoexcept

Sets every setting at once (clamped; non-finite fields are ignored). Any thread.

Definition at line 152 of file CharacterStage.h.

◆ settings()

template<FloatType T>
Settings dspark::CharacterStage< T >::settings ( ) const
inlinenoexcept
Returns
The settings in use.

Definition at line 163 of file CharacterStage.h.

Member Data Documentation

◆ kMaxChannels

template<FloatType T>
constexpr int dspark::CharacterStage< T >::kMaxChannels = 16
staticconstexpr

Definition at line 92 of file CharacterStage.h.


The documentation for this class was generated from the following file: