DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::LoopFinder< T > Class Template Referencefinal

Finds and renders bounded, deterministic loop seams. More...

#include <LoopFinder.h>

Classes

struct  Range
 
struct  Result
 
struct  Settings
 

Public Types

enum class  Status : std::uint8_t {
  Success , EmptyInput , InvalidArgument , InputTooShort ,
  InputTooLong , NonFiniteInput , InsufficientActivity , CandidateLimitExceeded ,
  NoAcceptableLoop , InvalidOutput , NumericalFailure
}
 

Public Member Functions

Result find (AudioBufferView< const T > audio, Range startRange, Range endRange, std::int64_t minLoopLength, std::int64_t maxLoopLength, const Settings &settings={}) const
 Searches explicit inclusive endpoint ranges for the lowest-cost supported loop seam.
 

Static Public Member Functions

static Status renderLoop (AudioBufferView< const T > audio, const Result &loop, AudioBufferView< T > output) noexcept
 Renders one normalized equal-power loop cycle without allocation.
 

Detailed Description

template<FloatType T>
class dspark::LoopFinder< T >

Finds and renders bounded, deterministic loop seams.

Template Parameters
TSample type (float or double).

find() is an offline operation: one caller owns an instance for the complete search and bounded scratch allocation is permitted. renderLoop() performs no allocation and is transactional; invalid or non-finite input leaves the destination unchanged. Source samples supplied to either operation must be finite.

Definition at line 52 of file LoopFinder.h.

Member Enumeration Documentation

◆ Status

template<FloatType T>
enum class dspark::LoopFinder::Status : std::uint8_t
strong
Enumerator
Success 
EmptyInput 
InvalidArgument 
InputTooShort 
InputTooLong 
NonFiniteInput 
InsufficientActivity 
CandidateLimitExceeded 
NoAcceptableLoop 
InvalidOutput 
NumericalFailure 

Definition at line 55 of file LoopFinder.h.

Member Function Documentation

◆ find()

template<FloatType T>
Result dspark::LoopFinder< T >::find ( AudioBufferView< const T >  audio,
Range  startRange,
Range  endRange,
std::int64_t  minLoopLength,
std::int64_t  maxLoopLength,
const Settings &  settings = {} 
) const
inline

Searches explicit inclusive endpoint ranges for the lowest-cost supported loop seam.

The complete source is checked for finiteness. Coarse and refinement coordinate counts are conservatively bounded before any candidate is scored; scratch is independent of the number of candidates.

Definition at line 120 of file LoopFinder.h.

◆ renderLoop()

template<FloatType T>
static Status dspark::LoopFinder< T >::renderLoop ( AudioBufferView< const T >  audio,
const Result &  loop,
AudioBufferView< T >  output 
)
inlinestaticnoexcept

Renders one normalized equal-power loop cycle without allocation.

Returns
Success, InvalidArgument, InvalidOutput or NumericalFailure.

Definition at line 355 of file LoopFinder.h.


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