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

The three lo-fi stages in the order the hardware they model applies them: quantise the word, hold it at a lower clock, then push it through an output stage that cannot represent the smallest codes. More...

#include <lofi_chain.hpp>

Public Member Functions

void set_sample_rate (double sr)
void set_bits (double bits)
 Word length in bits. 24 or above bypasses the quantiser.
void set_dither_mode (DitherMode mode)
 Quantizer dither is opt-in so existing chains remain bit-exact.
void set_noise_shaping (NoiseShapingOrder order)
 Error feedback is opt-in and may be used with or without dither.
void set_hold_rate_hz (double hz)
 Hold clock in Hz.
void set_jitter (double amount)
void set_smoothing (double amount)
void set_dead_zone (double amount)
 Fraction of full scale the output stage cannot represent, 0 to 0.9.
void set_seed (std::uint32_t seed)
void sync_configuration_from (const LofiChainT &other)
 Mirror parameter configuration while preserving this chain's independent reducer/filter state.
void reset ()
bool has_tail () const noexcept
SampleType process (SampleType input)
void process (SampleType *buffer, int num_samples)

Detailed Description

template<typename SampleType = float>
class pulp::signal::LofiChainT< SampleType >

The three lo-fi stages in the order the hardware they model applies them: quantise the word, hold it at a lower clock, then push it through an output stage that cannot represent the smallest codes.

Keeping them in one class rather than three loose calls is what makes the order a property of the code instead of a convention each caller has to remember. Any stage left at its default is a pass-through, so a voice can use one of the three without paying for the others.

This chain distorts, so it generates harmonics above the input's bandwidth and will alias if run at the host rate. Callers that care run it inside an oversampled section (pulp::signal::Oversampling); callers modelling a device that itself aliased run it at the host rate deliberately.

RT contract: every member allocates nothing and takes no locks.

Member Function Documentation

◆ has_tail()

template<typename SampleType = float>
bool pulp::signal::LofiChainT< SampleType >::has_tail ( ) const
inlinenoexcept

◆ process() [1/2]

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::process ( SampleType * buffer,
int num_samples )
inline

◆ process() [2/2]

template<typename SampleType = float>
SampleType pulp::signal::LofiChainT< SampleType >::process ( SampleType input)
inline

◆ reset()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::reset ( )
inline

◆ set_bits()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_bits ( double bits)
inline

Word length in bits. 24 or above bypasses the quantiser.

◆ set_dead_zone()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_dead_zone ( double amount)
inline

Fraction of full scale the output stage cannot represent, 0 to 0.9.

◆ set_dither_mode()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_dither_mode ( DitherMode mode)
inline

Quantizer dither is opt-in so existing chains remain bit-exact.

◆ set_hold_rate_hz()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_hold_rate_hz ( double hz)
inline

Hold clock in Hz.

At or above the sample rate the reducer is transparent.

◆ set_jitter()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_jitter ( double amount)
inline

◆ set_noise_shaping()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_noise_shaping ( NoiseShapingOrder order)
inline

Error feedback is opt-in and may be used with or without dither.

◆ set_sample_rate()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_sample_rate ( double sr)
inline

◆ set_seed()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_seed ( std::uint32_t seed)
inline

◆ set_smoothing()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::set_smoothing ( double amount)
inline

◆ sync_configuration_from()

template<typename SampleType = float>
void pulp::signal::LofiChainT< SampleType >::sync_configuration_from ( const LofiChainT< SampleType > & other)
inline

Mirror parameter configuration while preserving this chain's independent reducer/filter state.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/lofi_chain.hpp