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

Zero-allocation, thread-safe transient shaper. More...

#include <TransientDesigner.h>

Public Member Functions

 ~TransientDesigner ()=default
 
void prepare (const AudioSpec &spec) noexcept
 Prepares the processor with the current audio specification.
 
void prepare (double sampleRate) noexcept
 Prepares the processor with a specific sample rate.
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes an audio buffer in-place.
 
void setAttack (T amount) noexcept
 Sets attack (transient) emphasis.
 
void setSustain (T amount) noexcept
 Sets sustain (body) emphasis.
 
void setOutputDepRecovery (bool enabled) noexcept
 Enables output-dependent recovery (ODR).
 
void setCharacter (T amount) noexcept
 Sets character as a single macro-knob (overwrites attack AND sustain).
 
void reset () noexcept
 Clears all internal buffers and state. Must be lock-free.
 
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).
 

Detailed Description

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

Zero-allocation, thread-safe transient shaper.

The per-channel envelope recursion is inherently serial (no SIMD); the channel-outer loop keeps each channel's state in registers and the data accesses cache-friendly.

Template Parameters
TSample type (float or double).

Definition at line 63 of file TransientDesigner.h.

Constructor & Destructor Documentation

◆ ~TransientDesigner()

template<FloatType T>
dspark::TransientDesigner< T >::~TransientDesigner ( )
default

Member Function Documentation

◆ getState()

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

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

Definition at line 225 of file TransientDesigner.h.

◆ prepare() [1/2]

template<FloatType T>
void dspark::TransientDesigner< T >::prepare ( const AudioSpec spec)
inlinenoexcept

Prepares the processor with the current audio specification.

Parameters
specAudio specification including sample rate (invalid specs are ignored).

Definition at line 74 of file TransientDesigner.h.

◆ prepare() [2/2]

template<FloatType T>
void dspark::TransientDesigner< T >::prepare ( double  sampleRate)
inlinenoexcept

Prepares the processor with a specific sample rate.

Parameters
sampleRateThe operating sample rate in Hz. Non-finite or non-positive rates are ignored (a NaN rate used to pass the coefficient guard and poison the envelopes permanently).

Definition at line 87 of file TransientDesigner.h.

◆ processBlock()

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

Processes an audio buffer in-place.

Parameters
bufferView of the audio buffer to process.

Definition at line 99 of file TransientDesigner.h.

◆ reset()

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

Clears all internal buffers and state. Must be lock-free.

Definition at line 216 of file TransientDesigner.h.

◆ setAttack()

template<FloatType T>
void dspark::TransientDesigner< T >::setAttack ( amount)
inlinenoexcept

Sets attack (transient) emphasis.

Parameters
amount-100 to +100 (%). Positive = boost transients, negative = soften.

Definition at line 176 of file TransientDesigner.h.

◆ setCharacter()

template<FloatType T>
void dspark::TransientDesigner< T >::setCharacter ( amount)
inlinenoexcept

Sets character as a single macro-knob (overwrites attack AND sustain).

Parameters
amountRange [-1.0, 1.0]. -1 = soften transients/boost sustain, +1 = boost transients/reduce sustain.

Definition at line 205 of file TransientDesigner.h.

◆ setOutputDepRecovery()

template<FloatType T>
void dspark::TransientDesigner< T >::setOutputDepRecovery ( bool  enabled)
inlinenoexcept

Enables output-dependent recovery (ODR).

Parameters
enabledIf true, slow envelope release speed scales with output level.

Definition at line 196 of file TransientDesigner.h.

◆ setState()

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

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

Definition at line 237 of file TransientDesigner.h.

◆ setSustain()

template<FloatType T>
void dspark::TransientDesigner< T >::setSustain ( amount)
inlinenoexcept

Sets sustain (body) emphasis.

Parameters
amount-100 to +100 (%). Positive = boost sustain, negative = reduce.

Definition at line 186 of file TransientDesigner.h.


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