|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
Namespaces | |
| namespace | continuous_clip |
| namespace | fft |
| namespace | mp3 |
| namespace | native_clip_coefficients |
| namespace | offline_clip |
| namespace | offline_sinc |
| namespace | stereo_color_banks |
| namespace | stereo_color_coefficients |
| namespace | truepeak |
Classes | |
| class | AccountedAllocator |
| class | Adaa2 |
| Per-stream second-order ADAA state. More... | |
| struct | AdaaExciter |
| struct | AdaaHardClip |
| struct | AdaaPoint |
| struct | AdaaRationalKnee |
| struct | AdaaSecondDifference |
| struct | AdaaSine |
| struct | AdaaSinePolynomial |
| struct | AdaaSinePolynomialTerms |
| struct | AdaaTanh |
| struct | AdaaTape |
| class | AdaaTapeTable |
| struct | AllocationAccount |
| class | BitcrusherAlgorithm |
| class | ContinuousStereoColor |
| class | ConvolutionRate |
| class | CurveAlgorithm |
| struct | DcBlockState |
| Previous input and output of the one-pole DC blocker. More... | |
| class | DownsampleAlgorithm |
| class | DryPhase |
| Gives the dry side of a mix the phase that a high-pass leaves in the wet side, and none of its magnitude. More... | |
| class | ExciterAlgorithm |
| class | HardClipAlgorithm |
| class | KernelConvolver |
| A part of a DetailFilter: minimum-phase kernels designed as a SpectralFilter designs its own (detail::MinimumPhase), at the window and padding given, convolved in partitions of a block (a quarter of that window, up to the whole of it). More... | |
| struct | LadderCoeffs |
| Coefficients derived from g and the resonance. More... | |
| struct | LadderInputCoeffs |
| Coefficients of ladderStepInput(), derived by makeLadderInputCoeffs(). More... | |
| struct | LadderInputLane |
| One channel's registers while ladderStepInput() runs a sample. More... | |
| struct | LadderInputState |
| State of ladderStepInput(), in double whatever the sample type is. More... | |
| struct | LadderStageCoeffs |
| Coefficients of ladderStepStages(), derived by makeLadderStageCoeffs(). More... | |
| class | MinimumPhase |
| The minimum-phase kernel of a log magnitude, by its real cepstrum: what SpectralFilter and DetailFilter design their kernels with. More... | |
| class | MultiStageAlgorithm |
| class | OfflineAttenuation |
| struct | OfflineBeatEngine |
| class | OfflineBlock |
| class | OfflineBoundaryFeasibility |
| class | OfflineBoxSmoother |
| struct | OfflineClipCalibration |
| struct | OfflineClipMeasurement |
| struct | OfflineClipOptions |
| class | OfflineClipProcessor |
| class | OfflineConvolutionWindow |
| class | OfflineEndpointWeights |
| class | OfflineExclusions |
| struct | OfflineFailure |
| class | OfflineGainProduct |
| struct | OfflineGainRenderSettings |
| class | OfflineGainSource |
| class | OfflineHilbertMap |
| class | OfflineMemoryPool |
| class | OfflineProductCombination |
| class | OfflineProductWorkspace |
| class | OfflinePunchEnvelope |
| struct | OfflineScratchDeleter |
| class | OfflineSession |
| struct | OfflineSinkTransaction |
| struct | OfflineSoftClipOptions |
| struct | OfflineSourceSummary |
| class | OfflineStereoStream |
| class | OnsetNovelty |
| Shared whitening, spectral/complex flux and SuperFlux feature history. More... | |
| class | OnsetPeakPicker |
| Allocation-free symmetric novelty peak picker with an explicit frame clock. More... | |
| class | OnsetSpectrum |
| Reusable periodic-Hann real spectrum, without feature history. More... | |
| class | OversampledStereoColor |
| class | PhaseVocoderEngine |
| Identity-phase-locked STFT analysis/synthesis core (internal). More... | |
| class | RetimedDcBlock |
| class | ReverbBankPublisher |
| struct | ReverbPublisherNoopHooks |
| class | SampleReader |
| One voice's position in a zone and its band-limited read. More... | |
| struct | SampleZoneData |
| One validated zone, its audio copied and its loop crossfade baked. More... | |
| class | SaturationAlgorithm |
| class | ScaledSumSquares |
| Scaled sum of squares; caller validates finite input and counts values. More... | |
| class | StereoColor |
| class | StudioVocoder |
| Streaming phase-gradient vocoder with a strike-anchored time map. More... | |
| class | TanhAlgorithm |
| class | TapeAlgorithm |
| struct | TptSvfOutput |
| Lowpass and constant-skirt-gain bandpass outputs. More... | |
| struct | TptSvfState |
| Equivalent-current memories of the two trapezoidal integrators. More... | |
| class | TransformerAlgorithm |
| struct | TruePeakLoops |
| class | TubeAlgorithm |
| class | WavefolderAlgorithm |
| struct | WavetableFrame |
| struct | WavetableRows |
| One block's level pair, as WavetableBank's block readers see it. More... | |
Typedefs | |
| template<typename T > | |
| using | OfflineScratchArray = std::unique_ptr< T[], OfflineScratchDeleter< T > > |
| using | OfflineBeatMemory = OfflineMemoryPool |
Enumerations | |
| enum class | ClipperCurve { Hard , Tanh , Sine , GoldenRatio , SymmetricKnee , AsymmetricKnee } |
| enum class | LadderTap { LP6 , LP12 , LP18 , LP24 , BP12 , HP24 } |
| Output tap mix of the four-stage cascade. More... | |
Functions | |
| double | advanceBoxAverage (double incoming, double outgoing, double &sum, double inverseLength) noexcept |
| template<ClipperCurve Curve, FloatType T> | |
| constexpr T | clipperSmallSignalSlope () noexcept |
| Exact small-signal slope of the implemented stateless curve. | |
| template<ClipperCurve Curve, FloatType T> | |
| std::array< T, 2 > | clipperLinearLimits (T ceiling) noexcept |
| Exact linear-region endpoints of a rational clipping curve. | |
| template<ClipperCurve Curve, FloatType T> | |
| T | clipperShape (T sample, T ceiling) noexcept |
| Shared transfer functions; no state or implicit antialiasing. | |
| double | dcBlockStep (double pole, DcBlockState &state, double input) noexcept |
| Applies (1 - z^-1) / (1 - pole * z^-1), with a pole in [0, 1). | |
| template<FloatType T> | |
| LadderCoeffs< T > | makeLadderCoeffs (T g, T res) noexcept |
| Derives the ladder coefficients. | |
| template<LadderTap Tap, FloatType T> | |
| T | ladderStep (T input, std::array< T, 4 > &z, const LadderCoeffs< T > &c, T drive) noexcept |
| Advances the four TPT one-pole stages and the resolved feedback loop by one sample. | |
| template<FloatType T> | |
| LadderStageCoeffs | makeLadderStageCoeffs (T g, T res, T drive) noexcept |
| Derives the coefficients of the per-stage saturating ladder. | |
| double | ladderTanh (double a) noexcept |
| tanh(a) by its [9/8] continued-fraction convergent, clamped to +-1 where the convergent reaches 1 (|a| = 6.297). | |
| double | ladderTanhRatio (double a) noexcept |
| ladderTanh(a) / a, finite at a = 0 (where it is 1). | |
| template<LadderTap Tap, FloatType T> | |
| T | ladderStepStages (T input, std::array< T, 4 > &z, const LadderStageCoeffs &c) noexcept |
| Advances the per-stage saturating ladder by one sample. | |
| void | ladderTanhParts (double a2, double &num, double &den) noexcept |
| The two polynomials of ladderTanh() in a^2 (tanh(a) = a num / den), each summed as two halves so that both are ready four operations after a^2. | |
| void | ladderInputRefresh (LadderInputState &h, const LadderInputCoeffs &c) noexcept |
| Recomputes the carried sums after the states or the coefficients changed. | |
| template<FloatType T> | |
| LadderInputCoeffs | makeLadderInputCoeffs (double cutoffRatio, T res, T drive) noexcept |
| Derives the coefficients of the input-saturating ladder. | |
| template<LadderTap Tap, FloatType T> | |
| DSPARK_LADDER_INLINE T | ladderStepInput (T input, LadderInputState &h, const LadderInputCoeffs &c) noexcept |
| Advances the input-saturating ladder by one sample. | |
| template<LadderTap Tap, FloatType T> | |
| DSPARK_LADDER_INLINE void | ladderStepInputPair (T &a, T &b, LadderInputState &ha, LadderInputState &hb, const LadderInputCoeffs &c) noexcept |
| ladderStepInput() on two channels at once, sub-step by sub-step. | |
| double | logCosh (double x) noexcept |
| Stable log(cosh(x)), shared by the tanh antiderivative kernels. | |
| double | integralLogCoshTail (double a) noexcept |
| double | integralLogCosh (double x) noexcept |
| double | offlineClipPeakErrorDb (double peak, double target) noexcept |
| bool | offlineClipTargetMet (double peak, double target, double errorDb) noexcept |
| template<class Render > | |
| OfflineClipCalibration | offlineCalibrateClip (double initialCeiling, double target, Render render) |
| template<class Result , FloatType T, class Report , class CursorFactory > | |
| Result | offlineRenderGain (OfflineAudioSource< T > &source, const OfflineAudioSpec &spec, const OfflineFingerprint &expectedFingerprint, double inputPeak, bool valid, bool changed, const Report &report, OfflineAudioSink< T > &sink, const OfflineJobOptions &options, CursorFactory makeCursor, OfflineGainRenderSettings settings={}) |
| template<class LeftReader , class RightReader , class Consumer > | |
| void | offlineBandlimitedProduct (OfflineSession &job, std::int64_t frames, LeftReader left, RightReader right, Consumer consume, int block=0) |
| template<FloatType T> | |
| double | offlineRepresentablePeakGain (double inputPeak, double gain) noexcept |
| template<FloatType T, class Consume > | |
| OfflineSourceSummary | offlineScanSource (OfflineAudioSource< T > &source, const OfflineAudioSpec &spec, OfflineBlock< T > &scratch, const OfflineSession &job, OfflinePhase phase, Consume consume) |
| template<FloatType T, class Consume > | |
| void | offlineScanMagnitude (OfflineAudioSource< T > &source, const OfflineAudioSpec &spec, const OfflineFingerprint &expectedFingerprint, double inputPeak, OfflineBlock< T > &scratch, const OfflineSession &job, Consume consume) |
| template<class Function > | |
| void | offlineCallSink (Function &&function) |
| template<class Processor , FloatType T, int MaxChannels, class Options > | |
| Processor::Result | offlineRun (const Processor &processor, const AudioBuffer< T, MaxChannels > &input, AudioBuffer< T, MaxChannels > &output, double sampleRate, const Options &options, const OfflineJobOptions &job) |
| template<FloatType T> | |
| T | rationalKneeMagnitude (T magnitude, T knee, T ceiling) noexcept |
| Positive magnitude of the original Clipper rational soft knee. | |
| double | rationalKneeShape (double input, double positiveKnee, double negativeKnee) noexcept |
| Unit-ceiling curve with independent positive and negative knees. | |
| double | rationalKneeIntegral (double input, double positiveKnee, double negativeKnee) noexcept |
| Antiderivative of the unit-ceiling curve, with F(0) = 0. | |
| template<FloatType T> | |
| bool | buildSampleZone (const SampleZoneSpec< T > &z, SampleZoneData< T > &d) |
Validates and copies a zone, clamping its loop and baking the loop crossfade. False (and d unspecified) for a zone with no audio, an invalid rate or an empty key or velocity range. | |
| void | sampleZonePanGains (double pan, int channels, double gain, double &left, double &right, double &mono) noexcept |
Output gains of a zone at gain: a mono zone pans with constant power (unity at centre), a multichannel one balances its first two channels. mono is the gain for a single output channel. | |
| template<FloatType T> | |
| T | sampleGatherReduce (const T *lane) noexcept |
| The final reduction of the eight partial sums. | |
| template<int C, FloatType T> | |
| void | sampleGatherNarrow (const T *r0, const T *r1, T g, const T *x0, const T *x1, int taps, T *out) noexcept |
| Unit-scale gather of C (1 or 2) channels: the weights are the rows r0 and r1 blended by g, tap by tap, and each channel's sum is formed in the order of kSampleGatherLanes. | |
| template<FloatType T> | |
| TptSvfOutput< T > | tptSvfStep (T input, TptSvfState< T > &state, T a1, T a2, T a3) noexcept |
| Advances the expanded Simper TPT recurrence by one sample. | |
| double | hilbertIdealImpulse (std::int64_t index) noexcept |
| void | offlineFail (OfflineStatus status) |
| OfflineStatus | offlineExceptionStatus () noexcept |
| std::size_t | offlineBytes (std::uint64_t count, std::size_t size) |
| OfflineJobOptions | offlineRemaining (const OfflineJobOptions &job, std::size_t used) |
| void | offlineValidateSpec (const OfflineAudioSpec &spec, int maximumChannels=16) |
| template<FloatType T> | |
| void | offlineRead (OfflineAudioSource< T > &source, const OfflineAudioSpec &expected, std::int64_t first, AudioBufferView< T > block) |
| template<FloatType T> | |
| void | offlineHash (OfflineFingerprint &state, T sample) noexcept |
| void | appendStateJsonString (std::string &out, const std::string &s) |
| Appends a JSON string literal, escaping the characters JSON forbids. Keys follow the [A-Za-z0-9._] convention (so this normally emits verbatim), but the convention is not enforced on the writer or reader, and untrusted blobs can carry arbitrary key bytes; escaping keeps the emitted JSON valid and non-injectable in every case. | |
| void | appendStateJsonNumber (std::string &out, float v) |
| Locale-independent float rendering ("%.9g" with a forced dot). Non-finite payloads (NaN/Inf – e.g. a corrupt blob or a bugged parameter) are emitted as JSON-legal 0 so the output always parses and round-trips. | |
| const char * | parseStateJsonNumber (const char *s, const char *end, double &out) noexcept |
| Locale-independent number parse over [s, end); nullptr on failure. | |
| std::string | stateToJsonImpl (const std::vector< uint8_t > &blob, int depth) |
| std::vector< uint8_t > | stateFromJsonImpl (const std::string &json, int depth) |
| template<int Count, typename T > | |
| void | designSincPhase (T *out, double beta, double frac) noexcept |
| template<typename T > | |
| T | refineVertex (T a, T b, T c, T m) noexcept |
| template<typename T > | |
| T | gridReading (const T *s, const T *q, const T *h, const T *t, int i) noexcept |
| template<typename T > | |
| T | eighthCrests (const T *a, const T *e, int u, T m) noexcept |
| template<typename T > | |
| void | raiseToEighthSamples (const T *a, const T *e, T *peak, int first, int n) noexcept |
| WavetableFrame | wavetableFrame (double position, int numFrames) noexcept |
Variables | |
| constexpr double | kLadderStagesMaxGain = 6.313751514675041 |
| Largest prewarped integrator gain of the per-stage model: tan(0.45 pi), a cutoff of 0.45 * fs. | |
| constexpr int | kLadderStagesMaxIterations = 16 |
| Newton step cap of ladderStepStages() (the worst case measured is 10). | |
| constexpr double | kLadderStagesStateStartGain = 0.15 |
| Integrator gain below which ladderStepStages() falls back to the integrator states instead of the fixed-pivot solve (cutoff about 0.047 * fs) when the linear prediction is not used. | |
| constexpr double | kLadderStagesLinearStartLimit = 2.0 |
| Largest stage level of the linear prediction, in knee widths, at which ladderStepStages() starts Newton from that prediction (above kLadderStagesStateStartGain). | |
| constexpr int | kLadderInputSubsteps = 4 |
| Sub-steps per sample of the input-saturating ladder. | |
| constexpr double | kLadderTanhLimit = 6.297019181717114 |
| Where ladderTanh()'s rational function reaches 1, and that squared. | |
| constexpr double | kLadderTanhLimit2 = kLadderTanhLimit * kLadderTanhLimit |
| constexpr int | kSampleGatherLanes = 8 |
| template<FloatType T> | |
| constexpr std::array< T, 5 > | fastSinPolynomial |
| constexpr int | kMaxStateJsonDepth = 32 |
| constexpr std::array< double, 18 > | kWavetableNiemitalo |
| constexpr int | kWavetableOneLevel = 0 |
| Level layouts of a block: one level, two levels on one grid, two grids. | |
| constexpr int | kWavetableSameGrid = 1 |
| constexpr int | kWavetableTwoGrids = 2 |
| using dspark::detail::OfflineBeatMemory = typedef OfflineMemoryPool |
Definition at line 23 of file OfflineBeatEngine.h.
| using dspark::detail::OfflineScratchArray = typedef std::unique_ptr<T[], OfflineScratchDeleter<T> > |
Definition at line 312 of file OfflineProcessing.h.
|
strong |
| Enumerator | |
|---|---|
| Hard | |
| Tanh | |
| Sine | |
| GoldenRatio | |
| SymmetricKnee | |
| AsymmetricKnee | |
Definition at line 23 of file ClipperShape.h.
|
strong |
Output tap mix of the four-stage cascade.
| Enumerator | |
|---|---|
| LP6 | |
| LP12 | |
| LP18 | |
| LP24 | |
| BP12 | |
| HP24 | |
Definition at line 27 of file LadderZdf.h.
|
inlinenoexcept |
Definition at line 12 of file BoxAverage.h.
|
inline |
Locale-independent float rendering ("%.9g" with a forced dot). Non-finite payloads (NaN/Inf – e.g. a corrupt blob or a bugged parameter) are emitted as JSON-legal 0 so the output always parses and round-trips.
Definition at line 333 of file StateBlob.h.
|
inline |
Appends a JSON string literal, escaping the characters JSON forbids. Keys follow the [A-Za-z0-9._] convention (so this normally emits verbatim), but the convention is not enforced on the writer or reader, and untrusted blobs can carry arbitrary key bytes; escaping keeps the emitted JSON valid and non-injectable in every case.
Definition at line 299 of file StateBlob.h.
| bool dspark::detail::buildSampleZone | ( | const SampleZoneSpec< T > & | z, |
| SampleZoneData< T > & | d | ||
| ) |
Validates and copies a zone, clamping its loop and baking the loop crossfade. False (and d unspecified) for a zone with no audio, an invalid rate or an empty key or velocity range.
Definition at line 73 of file SampleReader.h.
|
inlinenoexcept |
Exact linear-region endpoints of a rational clipping curve.
Definition at line 45 of file ClipperShape.h.
|
inlinenoexcept |
Shared transfer functions; no state or implicit antialiasing.
Definition at line 62 of file ClipperShape.h.
|
constexprnoexcept |
Exact small-signal slope of the implemented stateless curve.
Definition at line 35 of file ClipperShape.h.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 289 of file TruePeakDetector.h.
|
inlinenoexcept |
Definition at line 363 of file TruePeakDetector.h.
|
inlinenoexcept |
Definition at line 345 of file TruePeakDetector.h.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Recomputes the carried sums after the states or the coefficients changed.
Definition at line 443 of file LadderZdf.h.
|
inlinenoexcept |
Advances the four TPT one-pole stages and the resolved feedback loop by one sample.
| input | Current input sample. |
| z | Integrator states, updated in place. |
| c | Coefficients from makeLadderCoeffs(). |
| drive | Feedback saturation: values above 1 pass the estimated feedback through a bounded tanh, at or below 1 it is linear. |
Definition at line 71 of file LadderZdf.h.
|
noexcept |
Advances the input-saturating ladder by one sample.
Linear trapezoidal stages with one saturator on the loop input,
dy_i/dt = wc * (y_{i-1} - y_i), y_0 = phi(x - k * y_4),
phi(v) = tanh(drive * v) / drive,
run in kLadderInputSubsteps sub-steps per sample: the input is interpolated linearly across them and the output is their mean, each with its level correction. The loop is closed without delay in every sub-step. With the cascade written y_4 = G^4 w + S (S from the states), the loop input u solves u + k G^4 phi(u) = x - k S. k G^4 stays below 0.036 at every setting (the sub-steps keep G small), so one Newton step from the explicit value r = x - k S leaves the square of that: phi(u) = t / (1 + k G^4 (1 - t^2)), t = tanh(drive r). The arithmetic is double whatever T is; the tanh is ladderTanh()'s rational function.
What a sample costs is the path from one loop drive to the next, so that path is kept to the saturator and one subtraction: the feedback sum a sub-step leaves behind is formed as cAhead . s, from the states it started from, plus kappa times its saturator output, and the stages themselves advance off that path. The function is always inlined: a block loop then keeps the state in registers and loads the coefficients once.
| input | Current input sample. |
| h | State of the channel, updated in place. Its carried sums must match its integrators and c (ladderInputRefresh() after either changed outside this function). |
| c | Coefficients from makeLadderInputCoeffs(). |
Definition at line 644 of file LadderZdf.h.
|
noexcept |
ladderStepInput() on two channels at once, sub-step by sub-step.
The two solves are independent, so taking their sub-steps in turn lets their dependency chains overlap. Each channel's arithmetic is that of ladderStepInput(): the outputs are the same.
| a | First channel's sample, replaced by its output. |
| b | Second channel's sample, replaced by its output. |
| ha | First channel's state. |
| hb | Second channel's state. |
| c | Coefficients from makeLadderInputCoeffs(). |
Definition at line 666 of file LadderZdf.h.
|
inlinenoexcept |
Advances the per-stage saturating ladder by one sample.
Solves the trapezoidal (TPT) discretization of the transistor-ladder model (Huovilainen 2004; D'Angelo and Valimaki 2013)
dy_i/dt = wc * [phi(y_{i-1}) - phi(y_i)], y_0 = x - k * y_4,
phi(v) = tanh(drive * v) / drive,
where every stage saturates and the feedback loop is delay-free. The four implicit stage equations y_i = s_i + g * (phi(y_{i-1}) - phi(y_i)) are solved jointly, as in Zavalishin's TPT treatment of nonlinear zero-delay loops:
The solve runs in double whatever T is. It stops when the largest update falls below c.tol knee widths, after at most kLadderStagesMaxIterations steps: measured with the float tolerance over noise, sine and saw inputs at 44.1 to 96 kHz, cutoff 0.004 to 0.45 * fs, resonance 0 to 1.15 and drive 0.3 to 10, a mean of 2.2 steps counting a fixed-pivot start as one (2.7 with the fixed-pivot start at every gain above the state-start limit), 4.1 Newton steps at the worst setting, and at most 7 (the cap is never reached). In the linear limit (drive -> 0) it reduces to ladderStep() without drive. Output taps are those of ladderStep().
| input | Current input sample. |
| z | Integrator states, updated in place. |
| c | Coefficients from makeLadderStageCoeffs(). |
Definition at line 278 of file LadderZdf.h.
|
inlinenoexcept |
tanh(a) by its [9/8] continued-fraction convergent, clamped to +-1 where the convergent reaches 1 (|a| = 6.297).
Absolute error below 6.8e-6 everywhere; the clamp leaves a slope step of 2.5e-5. The numerator and denominator are also used by ladderTanhRatio().
Definition at line 182 of file LadderZdf.h.
|
inlinenoexcept |
The two polynomials of ladderTanh() in a^2 (tanh(a) = a num / den), each summed as two halves so that both are ready four operations after a^2.
Definition at line 402 of file LadderZdf.h.
|
inlinenoexcept |
ladderTanh(a) / a, finite at a = 0 (where it is 1).
Definition at line 194 of file LadderZdf.h.
|
inlinenoexcept |
|
inlinenoexcept |
Derives the ladder coefficients.
| g | Prewarped integrator gain, tan(pi * fc / fs). |
| res | Resonance 0..1; 1 is the self-oscillation boundary (k = 4). |
Definition at line 48 of file LadderZdf.h.
|
inlinenoexcept |
Derives the coefficients of the input-saturating ladder.
The integrators are prewarped at the sub-step rate, so the cutoff is exact and the response below it is that of a ladder at (4 fs / pi) tan(pi fc / (4 fs)): within 0.2% of fc at 0.1 fs and 4.4% at 0.45 fs.
| cutoffRatio | Cutoff as a fraction of the sample rate; held within (0, 0.499]. |
| res | Resonance; 1 is the self-oscillation boundary (k = 4). |
| drive | Level scale of the saturator (> 0): the loop input saturates as tanh(drive * v) / drive. |
Definition at line 465 of file LadderZdf.h.
|
inlinenoexcept |
Derives the coefficients of the per-stage saturating ladder.
| g | Prewarped integrator gain, tan(pi * fc / fs); clamped to kLadderStagesMaxGain. |
| res | Resonance; 1 is the self-oscillation boundary (k = 4). |
| drive | Level scale of the stage nonlinearity (> 0): a stage saturates as tanh(drive * v) / drive. |
Definition at line 153 of file LadderZdf.h.
|
inline |
Definition at line 460 of file OfflineProduct.h.
|
inline |
Definition at line 289 of file OfflineProcessing.h.
| OfflineClipCalibration dspark::detail::offlineCalibrateClip | ( | double | initialCeiling, |
| double | target, | ||
| Render | render | ||
| ) |
Definition at line 82 of file OfflineClip.h.
|
inline |
Definition at line 186 of file OfflineWorker.h.
|
inlinenoexcept |
Definition at line 62 of file OfflineClip.h.
|
inlinenoexcept |
Definition at line 70 of file OfflineClip.h.
|
inlinenoexcept |
Definition at line 269 of file OfflineProcessing.h.
|
inline |
Definition at line 262 of file OfflineProcessing.h.
|
inlinenoexcept |
Definition at line 537 of file OfflineProcessing.h.
|
inline |
Definition at line 517 of file OfflineProcessing.h.
|
inline |
Definition at line 469 of file OfflineProcessing.h.
| Result dspark::detail::offlineRenderGain | ( | OfflineAudioSource< T > & | source, |
| const OfflineAudioSpec & | spec, | ||
| const OfflineFingerprint & | expectedFingerprint, | ||
| double | inputPeak, | ||
| bool | valid, | ||
| bool | changed, | ||
| const Report & | report, | ||
| OfflineAudioSink< T > & | sink, | ||
| const OfflineJobOptions & | options, | ||
| CursorFactory | makeCursor, | ||
| OfflineGainRenderSettings | settings = {} |
||
| ) |
Definition at line 124 of file OfflineGain.h.
|
inlinenoexcept |
Definition at line 26 of file OfflineWorker.h.
| Processor::Result dspark::detail::offlineRun | ( | const Processor & | processor, |
| const AudioBuffer< T, MaxChannels > & | input, | ||
| AudioBuffer< T, MaxChannels > & | output, | ||
| double | sampleRate, | ||
| const Options & | options, | ||
| const OfflineJobOptions & | job | ||
| ) |
Definition at line 206 of file OfflineWorker.h.
|
inline |
Definition at line 82 of file OfflineWorker.h.
|
inline |
Definition at line 45 of file OfflineWorker.h.
|
inline |
Definition at line 479 of file OfflineProcessing.h.
|
inlinenoexcept |
Locale-independent number parse over [s, end); nullptr on failure.
Definition at line 344 of file StateBlob.h.
|
inlinenoexcept |
Definition at line 375 of file TruePeakDetector.h.
|
inlinenoexcept |
Antiderivative of the unit-ceiling curve, with F(0) = 0.
Definition at line 39 of file RationalKnee.h.
|
inlinenoexcept |
Positive magnitude of the original Clipper rational soft knee.
Definition at line 21 of file RationalKnee.h.
|
inlinenoexcept |
Unit-ceiling curve with independent positive and negative knees.
Definition at line 31 of file RationalKnee.h.
|
inlinenoexcept |
Definition at line 326 of file TruePeakDetector.h.
|
inlinenoexcept |
Unit-scale gather of C (1 or 2) channels: the weights are the rows r0 and r1 blended by g, tap by tap, and each channel's sum is formed in the order of kSampleGatherLanes.
| r0 | First weight row, taps coefficients. |
| r1 | Second weight row, taps coefficients. |
| g | Blend from r0 toward r1: the weight is r0 + g * (r1 - r0). |
| x0 | First channel's samples, taps of them. |
| x1 | Second channel's samples, taps of them (unused for C = 1). |
| taps | Kernel length, a multiple of kSampleGatherLanes. |
| out | One sum per channel. |
Definition at line 185 of file SampleReader.h.
|
inlinenoexcept |
The final reduction of the eight partial sums.
Definition at line 167 of file SampleReader.h.
|
inlinenoexcept |
Output gains of a zone at gain: a mono zone pans with constant power (unity at centre), a multichannel one balances its first two channels. mono is the gain for a single output channel.
Definition at line 143 of file SampleReader.h.
|
inline |
Definition at line 441 of file StateBlob.h.
|
inline |
Definition at line 401 of file StateBlob.h.
|
inlinenoexcept |
Advances the expanded Simper TPT recurrence by one sample.
| input | Current input sample. |
| state | Integrator memories, updated in place. |
| a1 | 1 / (1 + g * (g + k)), where g = tan(pi * f / fs) and k = 1 / Q. |
| a2 | g * a1. |
| a3 | g * a2. |
|
inlinenoexcept |
Definition at line 119 of file WavetableBank.h.
|
inlineconstexpr |
|
inlineconstexpr |
Sub-steps per sample of the input-saturating ladder.
Definition at line 391 of file LadderZdf.h.
|
inlineconstexpr |
Largest stage level of the linear prediction, in knee widths, at which ladderStepStages() starts Newton from that prediction (above kLadderStagesStateStartGain).
The prediction is the drive-free ladder solved exactly (a dozen operations, no division): close to the root wherever the stages are not deep in saturation, and often closer than the fixed-pivot solve, which costs about one Newton step. With the float tolerance over noise, sines and a saw at 44.1 to 96 kHz, cutoff 0.004 to 0.45 * fs, resonance 0 to 1.15 and drive 0.3 to 10, the mean cost falls from 2.7 to 2.2 steps (a fixed-pivot start counted as one), and from 2.9 to 2.0 for sines at a 15 kHz cutoff with drive 3. Beyond the limit the fixed-pivot start takes over.
Definition at line 234 of file LadderZdf.h.
|
inlineconstexpr |
Largest prewarped integrator gain of the per-stage model: tan(0.45 pi), a cutoff of 0.45 * fs.
Above it the exact trapezoidal solution of the saturating stages stops being an audio signal: at a cutoff of 0.499 * fs (gain 280) its states grew to 90 and its output to 8.6 times full scale on full-scale noise, while at 0.45 * fs they stay below 6 and 1.6.
Definition at line 133 of file LadderZdf.h.
|
inlineconstexpr |
Newton step cap of ladderStepStages() (the worst case measured is 10).
Definition at line 206 of file LadderZdf.h.
|
inlineconstexpr |
Integrator gain below which ladderStepStages() falls back to the integrator states instead of the fixed-pivot solve (cutoff about 0.047 * fs) when the linear prediction is not used.
At a low gain each stage moves little in one sample, so the states are already a close start and the fixed-pivot solve (five tanh ratios and five divisions, about one Newton step of work) does not pay for itself. Above it the fixed-pivot start saves more than it costs.
Definition at line 218 of file LadderZdf.h.
|
inlineconstexpr |
Where ladderTanh()'s rational function reaches 1, and that squared.
Definition at line 394 of file LadderZdf.h.
|
inlineconstexpr |
Definition at line 395 of file LadderZdf.h.
|
constexpr |
Nesting cap for the JSON round-trip: real processor states nest 2-3 levels; a crafted input must not be able to overflow the stack.
Definition at line 292 of file StateBlob.h.
|
inlineconstexpr |
Lanes of the unit-scale gather's partial sums: tap t adds into sum t % 8, and the eight sums meet as ((s0 + s4) + (s1 + s5)) + ((s2 + s6) + (s3 + s7)).
Definition at line 163 of file SampleReader.h.
|
inlineconstexpr |
Niemitalo's 4x 6-point coefficients, three per polynomial coefficient c0..c5, in the order WavetableBank's interpolator uses them.
Definition at line 90 of file WavetableBank.h.
|
inlineconstexpr |
Level layouts of a block: one level, two levels on one grid, two grids.
Definition at line 133 of file WavetableBank.h.
| constexpr int dspark::detail::kWavetableSameGrid = 1 |
Definition at line 133 of file WavetableBank.h.
| constexpr int dspark::detail::kWavetableTwoGrids = 2 |
Definition at line 133 of file WavetableBank.h.