DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
TransientDesigner.h File Reference

Transient shaping via dual-envelope analysis (VCA Logarithmic Model). More...

#include "../Core/DspMath.h"
#include "../Core/AudioSpec.h"
#include "../Core/AudioBuffer.h"
#include "../Core/DenormalGuard.h"
#include "../Core/StateBlob.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <vector>
Include dependency graph for TransientDesigner.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dspark::TransientDesigner< T >
 Zero-allocation, thread-safe transient shaper. More...
 

Namespaces

namespace  dspark
 Main namespace for the DSPark framework.
 

Detailed Description

Transient shaping via dual-envelope analysis (VCA Logarithmic Model).

Emulates classic analog transient shapers by calculating the difference between a fast (peak) and slow (RMS) envelope in the logarithmic domain. This effectively separates the attack and release phases, applying independent gain adjustments to the transient and the body.

Threading model:

  • prepare() / reset() / getState() / setState(): setup or UI threads only, never concurrently with processBlock().
  • setAttack / setSustain / setCharacter / setOutputDepRecovery: RT-safe atomic publications from any thread (non-finite values are ignored).
  • Channels beyond the 16-channel state cap are left untouched.
  • Before prepare() the envelope coefficients are zero, which makes processBlock() an exact pass-through by construction.

Dependencies: DspMath.h, AudioSpec.h, AudioBuffer.h, DenormalGuard.h, StateBlob.h.

td.prepare(spec);
td.setAttack(0.5f); // +50% attack emphasis
td.setSustain(-0.3f); // -30% sustain reduction
td.processBlock(buffer);
Zero-allocation, thread-safe transient shaper.
void setSustain(T amount) noexcept
Sets sustain (body) emphasis.
void processBlock(AudioBufferView< T > buffer) noexcept
Processes an audio buffer in-place.
void prepare(const AudioSpec &spec) noexcept
Prepares the processor with the current audio specification.
void setAttack(T amount) noexcept
Sets attack (transient) emphasis.

Definition in file TransientDesigner.h.