Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::WavesetTransformerT< SampleType > Class Template Reference

A bounded, allocation-free-at-runtime waveset transformation engine. More...

#include <waveset_transformer.hpp>

Classes

struct  Capacity
struct  ProgramStep
struct  OperationProgram

Public Types

enum class  ZeroCrossingPolarity : std::uint8_t { Rising , Falling , Both }
enum class  Operation : std::uint8_t {
  Pass , Repeat , Omit , Reverse ,
  Rotate , Normalize , CoordinateSelect
}

Public Member Functions

bool prepare (double sample_rate, Capacity capacity)
bool prepared () const noexcept
bool set_program (std::uint8_t slot, const OperationProgram &program)
bool request_program_slot (std::uint8_t slot) noexcept
bool set_zero_crossing_polarity (ZeroCrossingPolarity polarity) noexcept
bool set_zero_crossing_epsilon (SampleType epsilon) noexcept
bool set_crossfade_law (CrossfadeGainLaw law) noexcept
bool set_crossfade_duration_ms (SampleType duration_ms) noexcept
bool set_normalize_ratio (SampleType ratio) noexcept
bool set_coordinate_seed (std::uint64_t seed) noexcept
int push (const SampleType *input, int count) noexcept
int pull (SampleType *output, int count) noexcept
void finish_input () noexcept
bool drained () const noexcept
void reset () noexcept
int latency_samples () const noexcept
int max_lookahead_samples () const noexcept
std::size_t tail_samples () const noexcept

Static Public Attributes

static constexpr std::size_t kMaxProgramSlots = 8
static constexpr std::size_t kMaxCoordinateChoices = 8
static constexpr int kMaxRepeatCount = 16
static constexpr int kMaxRotateWindow = 256

Detailed Description

template<typename SampleType = float>
requires (std::is_same_v<SampleType, float> || std::is_same_v<SampleType, double>)
class pulp::signal::WavesetTransformerT< SampleType >

A bounded, allocation-free-at-runtime waveset transformation engine.

Call prepare() and set_program() only from a control thread; both may allocate or copy. After preparation, push(), pull(), finish_input(), and the parameter setters are suitable for the realtime audio thread and perform no allocation or blocking synchronization. One audio thread owns push()/pull()/finish_input()/reset(); control-thread publication may race with that owner only through the documented setters and program-slot requests. Those operations fail closed by returning false when a concurrent lifecycle transition owns the packed control state.

push() may accept fewer samples than requested when its bounded reservation/output capacity is exhausted. The caller must pull available output and retry the unaccepted suffix. Output remains owned by the transformer until pull() consumes it, and drained() becomes true only after input has finished and all buffered output and reservations have retired.

Member Enumeration Documentation

◆ Operation

template<typename SampleType = float>
enum class pulp::signal::WavesetTransformerT::Operation : std::uint8_t
strong
Enumerator
Pass 
Repeat 
Omit 
Reverse 
Rotate 
Normalize 
CoordinateSelect 

◆ ZeroCrossingPolarity

template<typename SampleType = float>
enum class pulp::signal::WavesetTransformerT::ZeroCrossingPolarity : std::uint8_t
strong
Enumerator
Rising 
Falling 
Both 

Member Function Documentation

◆ drained()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::drained ( ) const
inlinenoexcept

◆ finish_input()

template<typename SampleType = float>
void pulp::signal::WavesetTransformerT< SampleType >::finish_input ( )
inlinenoexcept

◆ latency_samples()

template<typename SampleType = float>
int pulp::signal::WavesetTransformerT< SampleType >::latency_samples ( ) const
inlinenoexcept

◆ max_lookahead_samples()

template<typename SampleType = float>
int pulp::signal::WavesetTransformerT< SampleType >::max_lookahead_samples ( ) const
inlinenoexcept

◆ prepare()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::prepare ( double sample_rate,
Capacity capacity )
inline

◆ prepared()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::prepared ( ) const
inlinenoexcept

◆ pull()

template<typename SampleType = float>
int pulp::signal::WavesetTransformerT< SampleType >::pull ( SampleType * output,
int count )
inlinenoexcept

◆ push()

template<typename SampleType = float>
int pulp::signal::WavesetTransformerT< SampleType >::push ( const SampleType * input,
int count )
inlinenoexcept

◆ request_program_slot()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::request_program_slot ( std::uint8_t slot)
inlinenoexcept

◆ reset()

template<typename SampleType = float>
void pulp::signal::WavesetTransformerT< SampleType >::reset ( )
inlinenoexcept

◆ set_coordinate_seed()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_coordinate_seed ( std::uint64_t seed)
inlinenoexcept

◆ set_crossfade_duration_ms()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_crossfade_duration_ms ( SampleType duration_ms)
inlinenoexcept

◆ set_crossfade_law()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_crossfade_law ( CrossfadeGainLaw law)
inlinenoexcept

◆ set_normalize_ratio()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_normalize_ratio ( SampleType ratio)
inlinenoexcept

◆ set_program()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_program ( std::uint8_t slot,
const OperationProgram & program )
inline

◆ set_zero_crossing_epsilon()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_zero_crossing_epsilon ( SampleType epsilon)
inlinenoexcept

◆ set_zero_crossing_polarity()

template<typename SampleType = float>
bool pulp::signal::WavesetTransformerT< SampleType >::set_zero_crossing_polarity ( ZeroCrossingPolarity polarity)
inlinenoexcept

◆ tail_samples()

template<typename SampleType = float>
std::size_t pulp::signal::WavesetTransformerT< SampleType >::tail_samples ( ) const
inlinenoexcept

Member Data Documentation

◆ kMaxCoordinateChoices

template<typename SampleType = float>
std::size_t pulp::signal::WavesetTransformerT< SampleType >::kMaxCoordinateChoices = 8
staticconstexpr

◆ kMaxProgramSlots

template<typename SampleType = float>
std::size_t pulp::signal::WavesetTransformerT< SampleType >::kMaxProgramSlots = 8
staticconstexpr

◆ kMaxRepeatCount

template<typename SampleType = float>
int pulp::signal::WavesetTransformerT< SampleType >::kMaxRepeatCount = 16
staticconstexpr

◆ kMaxRotateWindow

template<typename SampleType = float>
int pulp::signal::WavesetTransformerT< SampleType >::kMaxRotateWindow = 256
staticconstexpr

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