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

A passive bidirectional waveguide segment. More...

#include <waveguide_line.hpp>

Public Member Functions

bool prepare (double sample_rate, double max_length_seconds=default_max_length_seconds)
void set_length_samples (SampleType length) noexcept
SampleType length_samples () const noexcept
SampleType current_length_samples () const noexcept
 Returns the delay head used by the next sample.
double round_trip_seconds () const noexcept
bool prepared () const noexcept
void read_outputs (SampleType &left_out, SampleType &right_out) const noexcept
 Reads both boundary arrivals without advancing either rail.
void push_inputs (SampleType left_in, SampleType right_in) noexcept
 Injects both boundary results and advances the retuning glide once.
void process (SampleType left_in, SampleType right_in, SampleType &left_out, SampleType &right_out) noexcept
 Convenience step for feed-forward use: read, then push.
void reset () noexcept
std::size_t retained_bytes () const noexcept

Static Public Attributes

static constexpr double minimum_length_samples = 3.0
static constexpr double minimum_max_length_seconds = 0.001
static constexpr double maximum_max_length_seconds = 1.0
static constexpr double default_max_length_seconds = 0.05
static constexpr double retune_seconds = 0.005

Detailed Description

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

A passive bidirectional waveguide segment.

left_in travels toward the right port and emerges as right_out; right_in travels toward the left port and emerges as left_out. Boundary reflection and intentional loss belong outside this class. The two rails use the shared prepared fractional-delay history, with double storage for both float and double public I/O. Lagrange-5 retuning is unity gain at DC and non-amplifying, but attenuates high frequencies at fractional delays; it is therefore passive rather than mathematically lossless.

prepare() is transactional and is the only allocating operation. All setters, process(), and reset() are bounded, lock-free, and allocation- free. Delay changes glide for five milliseconds because the live shared history exposes stateless Lagrange heads rather than a cross-interval Thiran retune operation.

Member Function Documentation

◆ current_length_samples()

template<typename SampleType = float>
SampleType pulp::signal::WaveguideLineT< SampleType >::current_length_samples ( ) const
inlinenodiscardnoexcept

Returns the delay head used by the next sample.

During a retune this converges from the previous length to length_samples().

◆ length_samples()

template<typename SampleType = float>
SampleType pulp::signal::WaveguideLineT< SampleType >::length_samples ( ) const
inlinenodiscardnoexcept

◆ prepare()

template<typename SampleType = float>
bool pulp::signal::WaveguideLineT< SampleType >::prepare ( double sample_rate,
double max_length_seconds = default_max_length_seconds )
inlinenodiscard

◆ prepared()

template<typename SampleType = float>
bool pulp::signal::WaveguideLineT< SampleType >::prepared ( ) const
inlinenodiscardnoexcept

◆ process()

template<typename SampleType = float>
void pulp::signal::WaveguideLineT< SampleType >::process ( SampleType left_in,
SampleType right_in,
SampleType & left_out,
SampleType & right_out )
inlinenoexcept

Convenience step for feed-forward use: read, then push.

Invalid input is injected as silence by FractionalDelayHistoryT, so a bad sample cannot poison either rail. Outputs fail closed to silence if the line is unprepared or a read fails.

◆ push_inputs()

template<typename SampleType = float>
void pulp::signal::WaveguideLineT< SampleType >::push_inputs ( SampleType left_in,
SampleType right_in )
inlinenoexcept

Injects both boundary results and advances the retuning glide once.

◆ read_outputs()

template<typename SampleType = float>
void pulp::signal::WaveguideLineT< SampleType >::read_outputs ( SampleType & left_out,
SampleType & right_out ) const
inlinenoexcept

Reads both boundary arrivals without advancing either rail.

Feedback compositions should call read_outputs(), calculate every boundary reflection/scattering result, then call push_inputs() in the same frame. This two-phase seam avoids adding a hidden sample at every external boundary.

◆ reset()

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

◆ retained_bytes()

template<typename SampleType = float>
std::size_t pulp::signal::WaveguideLineT< SampleType >::retained_bytes ( ) const
inlinenodiscardnoexcept

◆ round_trip_seconds()

template<typename SampleType = float>
double pulp::signal::WaveguideLineT< SampleType >::round_trip_seconds ( ) const
inlinenodiscardnoexcept

◆ set_length_samples()

template<typename SampleType = float>
void pulp::signal::WaveguideLineT< SampleType >::set_length_samples ( SampleType length)
inlinenoexcept

Member Data Documentation

◆ default_max_length_seconds

template<typename SampleType = float>
double pulp::signal::WaveguideLineT< SampleType >::default_max_length_seconds = 0.05
staticconstexpr

◆ maximum_max_length_seconds

template<typename SampleType = float>
double pulp::signal::WaveguideLineT< SampleType >::maximum_max_length_seconds = 1.0
staticconstexpr

◆ minimum_length_samples

template<typename SampleType = float>
double pulp::signal::WaveguideLineT< SampleType >::minimum_length_samples = 3.0
staticconstexpr

◆ minimum_max_length_seconds

template<typename SampleType = float>
double pulp::signal::WaveguideLineT< SampleType >::minimum_max_length_seconds = 0.001
staticconstexpr

◆ retune_seconds

template<typename SampleType = float>
double pulp::signal::WaveguideLineT< SampleType >::retune_seconds = 0.005
staticconstexpr

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