|
| void | set_sample_rate (double sr) |
| void | set_hold_rate_hz (double hz) |
| | Rate the held samples are clocked at, in Hz.
|
| void | set_jitter (double amount) |
| | Clock jitter as a fraction of the hold period, 0 to 1.
|
| void | set_smoothing (double amount) |
| | Strength of the reconstruction lowpass, 0 (bypassed, raw images) to 1 (corner at the hold rate's Nyquist).
|
| void | set_seed (std::uint32_t seed) |
| void | sync_configuration_from (const SampleRateReducerT &other) |
| | Mirror another reducer's parameter configuration without copying its held sample, clock phase, filter history, or RNG position.
|
| void | reset () |
| bool | has_tail () const noexcept |
| SampleType | process (SampleType input) |
template<typename SampleType = float>
class pulp::signal::SampleRateReducerT< SampleType >
Sample-and-hold rate reducer with clock jitter and a reconstruction filter.
Holding a sample for several output samples is a zero-order hold, which mirrors the signal around the hold rate. Those images are the point — they are the grit that a "lo-fi" control is asked for — but they can be more than a caller wants, so the class ends with a one-pole lowpass whose corner tracks the hold rate and thins them out. Callers who want the raw folded spectrum set the smoothing to zero.
The jitter perturbs the hold clock's period rather than its output. Early samplers clocked their converters from free-running oscillators with no phase relationship to the audio, so the hold boundaries drifted; that drift broadens the image skirts and is why an emulation with a perfectly regular hold sounds cleaner than the hardware it models. Jitter is driven by a deterministic generator so a render stays reproducible.
RT contract: every member allocates nothing and takes no locks.
template<typename SampleType = float>
Rate the held samples are clocked at, in Hz.
Clamped to the sample rate, at or above which the reducer is transparent. The default is unbounded rather than a fixed number of Hz, so an unconfigured reducer stays transparent at every sample rate instead of quietly decimating whenever the host runs faster than whatever default was chosen.
template<typename SampleType = float>
Strength of the reconstruction lowpass, 0 (bypassed, raw images) to 1 (corner at the hold rate's Nyquist).
One pole is a gentle slope, so this attenuates the images rather than removing them — which is the behaviour of the reconstruction filters the stage models, and leaves enough of the hold's character to still be worth having.