Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::SnapChunks Class Reference

The chunks of [0, num_samples), consecutive and at most kSnapChunkSamples long, as a range. More...

#include <denormal.hpp>

Classes

class  iterator

Public Member Functions

constexpr SnapChunks (std::size_t num_samples) noexcept
constexpr iterator begin () const noexcept
constexpr iterator end () const noexcept

Detailed Description

The chunks of [0, num_samples), consecutive and at most kSnapChunkSamples long, as a range.

The caller snaps its register-resident state at the end of each chunk.

A range rather than a callback on purpose: a loop body passed as a lambda that captures a pass's state arrays by reference kept that state in memory instead of registers and made an eight-section cascade measurably slower; the range-for keeps the body in the caller's own scope.

for (const auto [begin, end] : snap_chunks(n)) {
for (std::size_t i = begin; i < end; ++i)
s = recursion(s, buffer[i]);
s = snap_to_zero(s);
}
constexpr iterator end() const noexcept
Definition denormal.hpp:165
constexpr iterator begin() const noexcept
Definition denormal.hpp:162
@ buffer
A borrowed static buffer with a traversable playhead.
Definition granular.hpp:110
T snap_to_zero(T x)
Returns 0 if |x| < snap_threshold, else x.
Definition denormal.hpp:45
@ i
Definition formant_filter_bank.hpp:20
constexpr SnapChunks snap_chunks(std::size_t num_samples) noexcept
Definition denormal.hpp:173

Constructor & Destructor Documentation

◆ SnapChunks()

pulp::signal::SnapChunks::SnapChunks ( std::size_t num_samples)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ begin()

iterator pulp::signal::SnapChunks::begin ( ) const
inlineconstexprnoexcept

◆ end()

iterator pulp::signal::SnapChunks::end ( ) const
inlineconstexprnoexcept

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