|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Reel-to-reel tape emulation with physical hysteresis and transport. More...
#include <TapeMachine.h>
Public Types | |
| enum class | Standard { NAB , CCIR } |
| Playback equalization standard. More... | |
| enum class | Speed { IPS_7_5 , IPS_15 , IPS_30 } |
| Tape speed. More... | |
Public Member Functions | |
| void | prepare (const AudioSpec &spec) |
| Allocates the whole chain. 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 (keeps parameters). RT-safe. | |
| void | setDrive (T driveDb) noexcept |
| Input drive in dB [-12, +24]. Level-compensated: more drive means more saturation at roughly constant loudness. Non-finite values are ignored. | |
| void | setBias (T bias) noexcept |
| Bias setting [0, 1]; 0.5 is nominal calibration (carrier at 3x the JA field constant: full branch-memory erasure, clean odd saturation). Below nominal the carrier drops under the erase threshold: growing distortion and the level instability of a real under-biased machine. Above nominal, self-erasure progressively rolls off the top octave. Non-finite values are ignored. | |
| void | setOversampling (int factor) |
| Configures internal oversampling of the biased hysteresis core (RF-009/ADR-011 transparency policy). SETUP THREAD ONLY - it reallocates the polyphase filters and re-prepares/re-calibrates the whole chain exactly like prepare(); never call it concurrently with processBlock(). | |
| int | getOversamplingFactor () const noexcept |
| Active oversampling factor (1 = off, 4 = default). | |
| void | setSpeed (Speed s) noexcept |
| Tape speed (changes EQ time constants, losses and head bump). Out-of-range values are clamped. | |
| void | setStandard (Standard s) noexcept |
| Equalization standard (NAB adds the LF time constant). Out-of-range values are clamped. | |
| void | setLossEffects (T amount) noexcept |
| Playback loss intensity [0, 1] (0 bypasses the loss FIR). Non-finite values are ignored. | |
| void | setHeadBump (T amount) noexcept |
| Head-bump resonance intensity [0, 1] (~2.5 dB at full). Non-finite values are ignored. | |
| void | setWowFlutter (T amount) noexcept |
| Wow & flutter depth [0, 1] (~0.25% peak pitch deviation at 1). Non-finite values are ignored. | |
| void | setNoise (T dbfs) noexcept |
| Tape hiss level in dBFS (e.g. -55 for audible vintage hiss); values <= -120 disable it (default). Non-finite values are ignored. | |
| void | setMix (T mix) noexcept |
| Dry/wet mix [0, 1]; dry is latency-compensated. Non-finite values are ignored. | |
| T | getDrive () const noexcept |
| T | getBias () const noexcept |
| Speed | getSpeed () const noexcept |
| Standard | getStandard () const noexcept |
| T | getLossEffects () const noexcept |
| T | getHeadBump () const noexcept |
| T | getWowFlutter () const noexcept |
| T | getNoise () const noexcept |
| T | getMix () const noexcept |
| int | getLatency () const noexcept |
| Total latency in samples (active oversampler + loss FIR + transport delay); reflects the current factor for host PDC. | |
| int | getLatencySamples () const noexcept |
| Alias of getLatency() under the framework-wide latency-reporter name (RNF-005), so ProcessorChain::getLatency() includes this stage. | |
| 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. | |
Reel-to-reel tape emulation with physical hysteresis and transport.
| T | Sample type (float or double). |
Definition at line 121 of file TapeMachine.h.
|
strong |
|
strong |
|
inlinenoexcept |
Definition at line 372 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 371 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 382 of file TapeMachine.h.
|
inlinenoexcept |
Total latency in samples (active oversampler + loss FIR + transport delay); reflects the current factor for host PDC.
Definition at line 389 of file TapeMachine.h.
|
inlinenoexcept |
Alias of getLatency() under the framework-wide latency-reporter name (RNF-005), so ProcessorChain::getLatency() includes this stage.
Definition at line 393 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 381 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 385 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 384 of file TapeMachine.h.
|
inlinenoexcept |
Active oversampling factor (1 = off, 4 = default).
Definition at line 305 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 373 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 377 of file TapeMachine.h.
|
inline |
Serializes the parameter state (setup/UI threads; allocates).
Definition at line 396 of file TapeMachine.h.
|
inlinenoexcept |
Definition at line 383 of file TapeMachine.h.
|
inline |
Allocates the whole chain. 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 135 of file TapeMachine.h.
|
inlinenoexcept |
Processes a block in-place. Pass-through until prepare() succeeds.
Definition at line 436 of file TapeMachine.h.
|
inlinenoexcept |
Clears all signal state (keeps parameters). RT-safe.
Definition at line 227 of file TapeMachine.h.
|
inlinenoexcept |
Bias setting [0, 1]; 0.5 is nominal calibration (carrier at 3x the JA field constant: full branch-memory erasure, clean odd saturation). Below nominal the carrier drops under the erase threshold: growing distortion and the level instability of a real under-biased machine. Above nominal, self-erasure progressively rolls off the top octave. Non-finite values are ignored.
Definition at line 275 of file TapeMachine.h.
|
inlinenoexcept |
Input drive in dB [-12, +24]. Level-compensated: more drive means more saturation at roughly constant loudness. Non-finite values are ignored.
Definition at line 262 of file TapeMachine.h.
|
inlinenoexcept |
Head-bump resonance intensity [0, 1] (~2.5 dB at full). Non-finite values are ignored.
Definition at line 340 of file TapeMachine.h.
|
inlinenoexcept |
Playback loss intensity [0, 1] (0 bypasses the loss FIR). Non-finite values are ignored.
Definition at line 331 of file TapeMachine.h.
|
inlinenoexcept |
Dry/wet mix [0, 1]; dry is latency-compensated. Non-finite values are ignored.
Definition at line 365 of file TapeMachine.h.
|
inlinenoexcept |
Tape hiss level in dBFS (e.g. -55 for audible vintage hiss); values <= -120 disable it (default). Non-finite values are ignored.
Definition at line 357 of file TapeMachine.h.
|
inline |
Configures internal oversampling of the biased hysteresis core (RF-009/ADR-011 transparency policy). SETUP THREAD ONLY - it reallocates the polyphase filters and re-prepares/re-calibrates the whole chain exactly like prepare(); never call it concurrently with processBlock().
| factor | Power-of-two multiplier in {1,2,4,8,16}. DEFAULT 4. 1 = OFF (no internal resampling, zero added oversampler latency; the AC-bias carrier then lands in-band at 0.375 * the base rate, so 1x is only sensible under host/chain oversampling). CPU scales ~linearly with the factor. Invalid/non-power-of-two values are ignored. getLatency() reflects the new factor after this call. |
Definition at line 295 of file TapeMachine.h.
|
inlinenoexcept |
Tape speed (changes EQ time constants, losses and head bump). Out-of-range values are clamped.
Definition at line 309 of file TapeMachine.h.
|
inlinenoexcept |
Equalization standard (NAB adds the LF time constant). Out-of-range values are clamped.
Definition at line 320 of file TapeMachine.h.
|
inline |
Restores parameters from a blob (tolerant; rejects foreign ids).
Definition at line 415 of file TapeMachine.h.
|
inlinenoexcept |
Wow & flutter depth [0, 1] (~0.25% peak pitch deviation at 1). Non-finite values are ignored.
Definition at line 349 of file TapeMachine.h.