|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
Frequency-domain hold with tonal and diffuse phase modes. More...
#include <SpectralFreeze.h>
Public Types | |
| enum class | PhaseMode : std::uint8_t { Tonal , Diffuse } |
| Phase evolution used by the captured spectrum. More... | |
Public Member Functions | |
| void | prepare (const AudioSpec &spec, int fftSize=2048, int hopSize=0) |
| Prepares the processor and allocates all audio-path storage. | |
| void | reset () noexcept |
| Clears WOLA, history, capture and transition state. Requested controls are intentionally preserved. | |
| void | setFrozen (bool frozen) noexcept |
| Publishes the requested freeze state with one atomic RMW. | |
| bool | isFrozen () const noexcept |
| Returns the requested freeze state, not transition completion. | |
| void | setPhaseMode (PhaseMode mode) noexcept |
| Publishes the requested phase mode with one atomic RMW. Any representation other than exactly Diffuse selects Tonal. | |
| PhaseMode | getPhaseMode () const noexcept |
| Returns the requested phase mode. | |
| std::vector< uint8_t > | getState () const |
| Serializes the requested freeze state and phase mode (setup/UI threads; allocates). The FFT and hop sizes are prepare() arguments and are not part of it. | |
| bool | setState (const uint8_t *data, size_t size) |
| Restores the freeze request and phase mode from a blob (tolerant; rejects foreign ids). A restored freeze behaves exactly as setFrozen(true) does. | |
| int | getLatency () const noexcept |
| Returns the exact input-signal latency, or zero before prepare. | |
| int | getFFTSize () const noexcept |
| Returns the prepared FFT size, or zero before prepare. | |
| int | getHopSize () const noexcept |
| Returns the prepared hop size, or zero before prepare. | |
| int | getTransitionSamples () const noexcept |
| Returns the N-sample transition duration, or zero unprepared. | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Processes an in-place block without allocation or locking. | |
Frequency-domain hold with tonal and diffuse phase modes.
| T | Sample type (float or double). |
Definition at line 56 of file SpectralFreeze.h.
|
strong |
Phase evolution used by the captured spectrum.
| Enumerator | |
|---|---|
| Tonal | |
| Diffuse | |
Definition at line 60 of file SpectralFreeze.h.
|
inlinenoexcept |
Returns the prepared FFT size, or zero before prepare.
Definition at line 203 of file SpectralFreeze.h.
|
inlinenoexcept |
Returns the prepared hop size, or zero before prepare.
Definition at line 209 of file SpectralFreeze.h.
|
inlinenoexcept |
Returns the exact input-signal latency, or zero before prepare.
Definition at line 197 of file SpectralFreeze.h.
|
inlinenoexcept |
Returns the requested phase mode.
Definition at line 166 of file SpectralFreeze.h.
|
inline |
Serializes the requested freeze state and phase mode (setup/UI threads; allocates). The FFT and hop sizes are prepare() arguments and are not part of it.
Definition at line 176 of file SpectralFreeze.h.
|
inlinenoexcept |
Returns the N-sample transition duration, or zero unprepared.
Definition at line 215 of file SpectralFreeze.h.
|
inlinenoexcept |
Returns the requested freeze state, not transition completion.
Definition at line 148 of file SpectralFreeze.h.
|
inline |
Prepares the processor and allocates all audio-path storage.
Invalid specifications are ignored and preserve the current stream. FFT requests are clamped to [256,32768] and rounded upward to a power of two. Only N/8, N/4 and N/2 are accepted as explicit hop sizes; every other hop selects N/4.
Definition at line 70 of file SpectralFreeze.h.
|
inlinenoexcept |
Processes an in-place block without allocation or locking.
Missing prepared channels advance on zero input. Runtime channels beyond the prepared width remain bit-for-bit untouched. Oversize calls are internally sliced without disturbing absolute hop anchors.
Definition at line 227 of file SpectralFreeze.h.
|
inlinenoexcept |
Clears WOLA, history, capture and transition state. Requested controls are intentionally preserved.
Definition at line 132 of file SpectralFreeze.h.
|
inlinenoexcept |
Publishes the requested freeze state with one atomic RMW.
Definition at line 139 of file SpectralFreeze.h.
|
inlinenoexcept |
Publishes the requested phase mode with one atomic RMW. Any representation other than exactly Diffuse selects Tonal.
Definition at line 157 of file SpectralFreeze.h.
|
inline |
Restores the freeze request and phase mode from a blob (tolerant; rejects foreign ids). A restored freeze behaves exactly as setFrozen(true) does.
Definition at line 187 of file SpectralFreeze.h.