DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::TransformerModel< T > Class Template Reference

Physical audio-transformer coloration (flux-domain JA hysteresis). More...

#include <TransformerModel.h>

Public Member Functions

void prepare (const AudioSpec &spec)
 Allocates per-channel circuit state. Invalid specs (non-positive or non-finite rate, block size or channel count) are ignored: the previous state is kept and an unprepared instance stays pass-through.
 
void reset () noexcept
 Clears all signal state. RT-safe.
 
void setDrive (T db) noexcept
 Core drive in dB [-12, +24]; loudness-compensated. Non-finite values are ignored.
 
void setCoreSize (T size) noexcept
 Core size [0, 1]: small chokes at 40 Hz and saturates early, big rings to 5 Hz with more low-end headroom. Default 0.5. Non-finite values are ignored.
 
void setResonance (T amount) noexcept
 Leakage/capacitance HF bell amount [0, 1] (Jensen-style). Non-finite values are ignored.
 
void setMix (T mix) noexcept
 Dry/wet mix [0, 1]; smoothed linearly over one block. Zero latency: no compensation needed. Non-finite values are ignored.
 
getDrive () const noexcept
 
getCoreSize () const noexcept
 
getResonance () const noexcept
 
getMix () const noexcept
 
std::vector< uint8_t > getState () const
 Serializes the parameter state (setup/UI threads; allocates).
 
bool setState (const uint8_t *data, size_t size)
 Restores parameters from a blob (tolerant; rejects foreign ids).
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes a block in-place. Pass-through until prepare() succeeds.
 

Static Public Member Functions

static constexpr int getLatency () noexcept
 Zero - the model is all minimum-phase IIR and memoryless NR.
 

Detailed Description

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

Physical audio-transformer coloration (flux-domain JA hysteresis).

Template Parameters
TSample type (float or double).

Definition at line 85 of file TransformerModel.h.

Member Function Documentation

◆ getCoreSize()

template<FloatType T>
T dspark::TransformerModel< T >::getCoreSize ( ) const
inlinenoexcept

Definition at line 174 of file TransformerModel.h.

◆ getDrive()

template<FloatType T>
T dspark::TransformerModel< T >::getDrive ( ) const
inlinenoexcept

Definition at line 173 of file TransformerModel.h.

◆ getLatency()

template<FloatType T>
static constexpr int dspark::TransformerModel< T >::getLatency ( )
inlinestaticconstexprnoexcept

Zero - the model is all minimum-phase IIR and memoryless NR.

Definition at line 179 of file TransformerModel.h.

◆ getMix()

template<FloatType T>
T dspark::TransformerModel< T >::getMix ( ) const
inlinenoexcept

Definition at line 176 of file TransformerModel.h.

◆ getResonance()

template<FloatType T>
T dspark::TransformerModel< T >::getResonance ( ) const
inlinenoexcept

Definition at line 175 of file TransformerModel.h.

◆ getState()

template<FloatType T>
std::vector< uint8_t > dspark::TransformerModel< T >::getState ( ) const
inline

Serializes the parameter state (setup/UI threads; allocates).

Definition at line 182 of file TransformerModel.h.

◆ prepare()

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

Allocates per-channel circuit state. Invalid specs (non-positive or non-finite rate, block size or channel count) are ignored: the previous state is kept and an unprepared instance stays pass-through.

Definition at line 94 of file TransformerModel.h.

◆ processBlock()

template<FloatType T>
void dspark::TransformerModel< T >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Processes a block in-place. Pass-through until prepare() succeeds.

Definition at line 209 of file TransformerModel.h.

◆ reset()

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

Clears all signal state. RT-safe.

Definition at line 116 of file TransformerModel.h.

◆ setCoreSize()

template<FloatType T>
void dspark::TransformerModel< T >::setCoreSize ( size)
inlinenoexcept

Core size [0, 1]: small chokes at 40 Hz and saturates early, big rings to 5 Hz with more low-end headroom. Default 0.5. Non-finite values are ignored.

Definition at line 149 of file TransformerModel.h.

◆ setDrive()

template<FloatType T>
void dspark::TransformerModel< T >::setDrive ( db)
inlinenoexcept

Core drive in dB [-12, +24]; loudness-compensated. Non-finite values are ignored.

Definition at line 139 of file TransformerModel.h.

◆ setMix()

template<FloatType T>
void dspark::TransformerModel< T >::setMix ( mix)
inlinenoexcept

Dry/wet mix [0, 1]; smoothed linearly over one block. Zero latency: no compensation needed. Non-finite values are ignored.

Definition at line 167 of file TransformerModel.h.

◆ setResonance()

template<FloatType T>
void dspark::TransformerModel< T >::setResonance ( amount)
inlinenoexcept

Leakage/capacitance HF bell amount [0, 1] (Jensen-style). Non-finite values are ignored.

Definition at line 158 of file TransformerModel.h.

◆ setState()

template<FloatType T>
bool dspark::TransformerModel< T >::setState ( const uint8_t *  data,
size_t  size 
)
inline

Restores parameters from a blob (tolerant; rejects foreign ids).

Definition at line 195 of file TransformerModel.h.


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