DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::LaneCascade< T, Lanes > Class Template Reference

A cascade of biquads over the lanes of a vector, with latency. More...

#include <LaneCascade.h>

Public Member Functions

void prepare (int sections, int channels)
 Allocates for a number of sections and channels; every section starts transparent (b0 = 1).
 
int getNumSections () const noexcept
 
void setCoeffs (int section, const BiquadCoeffs &c) noexcept
 Sets a section's coefficients at once (ends any ramp of it).
 
void setTargetCoeffs (int section, const BiquadCoeffs &c) noexcept
 The coefficients a section ramps to at the next startRamp() (sections not given a target keep the one they had).
 
void startRamp (int samples) noexcept
 Ramps every section linearly from where it is to its target over samples (0: at once); the ramp ends exactly on the targets.
 
void rampCoeffs (int section, const BiquadCoeffs &c, int samples) noexcept
 Ramps one section to a target over samples (startRamp() on every section's target).
 
BiquadCoeffs getCoeffs (int section) const noexcept
 
void reset () noexcept
 Clears the history and the pipeline (the coefficients stay).
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Runs a block in place on the prepared channels (extra ones pass).
 

Static Public Member Functions

static constexpr int getLatency () noexcept
 

Detailed Description

template<FloatType T, int Lanes = 8>
class dspark::LaneCascade< T, Lanes >

A cascade of biquads over the lanes of a vector, with latency.

Template Parameters
TSample type (float or double); the arithmetic is double.
LanesLanes: 2, 4, 8 or 16 (latency Lanes - 1 samples).

Definition at line 52 of file LaneCascade.h.

Member Function Documentation

◆ getCoeffs()

template<FloatType T, int Lanes = 8>
BiquadCoeffs dspark::LaneCascade< T, Lanes >::getCoeffs ( int  section) const
inlinenoexcept
Returns
A section's coefficients now.

Definition at line 134 of file LaneCascade.h.

◆ getLatency()

template<FloatType T, int Lanes = 8>
static constexpr int dspark::LaneCascade< T, Lanes >::getLatency ( )
inlinestaticconstexprnoexcept
Returns
The latency in samples: one per lane after the first.

Definition at line 81 of file LaneCascade.h.

◆ getNumSections()

template<FloatType T, int Lanes = 8>
int dspark::LaneCascade< T, Lanes >::getNumSections ( ) const
inlinenoexcept

Definition at line 79 of file LaneCascade.h.

◆ prepare()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::prepare ( int  sections,
int  channels 
)
inline

Allocates for a number of sections and channels; every section starts transparent (b0 = 1).

Parameters
sectionsSections (at least 1; rounded up to a multiple of the lanes).
channelsChannels (at least 1).

Definition at line 63 of file LaneCascade.h.

◆ processBlock()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Runs a block in place on the prepared channels (extra ones pass).

Definition at line 151 of file LaneCascade.h.

◆ rampCoeffs()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::rampCoeffs ( int  section,
const BiquadCoeffs &  c,
int  samples 
)
inlinenoexcept

Ramps one section to a target over samples (startRamp() on every section's target).

Definition at line 127 of file LaneCascade.h.

◆ reset()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::reset ( )
inlinenoexcept

Clears the history and the pipeline (the coefficients stay).

Definition at line 144 of file LaneCascade.h.

◆ setCoeffs()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::setCoeffs ( int  section,
const BiquadCoeffs &  c 
)
inlinenoexcept

Sets a section's coefficients at once (ends any ramp of it).

Definition at line 84 of file LaneCascade.h.

◆ setTargetCoeffs()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::setTargetCoeffs ( int  section,
const BiquadCoeffs &  c 
)
inlinenoexcept

The coefficients a section ramps to at the next startRamp() (sections not given a target keep the one they had).

Definition at line 97 of file LaneCascade.h.

◆ startRamp()

template<FloatType T, int Lanes = 8>
void dspark::LaneCascade< T, Lanes >::startRamp ( int  samples)
inlinenoexcept

Ramps every section linearly from where it is to its target over samples (0: at once); the ramp ends exactly on the targets.

Definition at line 108 of file LaneCascade.h.


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