Mixes a delayed, low-pass-filtered copy of each channel into the opposite ear. More...
#include <headphone_crossfeed.hpp>
Public Member Functions | |
| HeadphoneCrossfeedT () noexcept | |
| bool | prepare (double sample_rate) noexcept |
| double | sample_rate () const noexcept |
| void | set_enabled (bool enabled) noexcept |
| bool | enabled () const noexcept |
| void | set_amount (double amount01) noexcept |
| Normalized crossfeed amount. | |
| double | amount () const noexcept |
| double | crossfeed_gain () const noexcept |
| void | set_delay_ms (double delay_ms) noexcept |
| Interaural delay in milliseconds, clamped to [0, 1]. | |
| double | delay_ms () const noexcept |
| double | delay_samples () const noexcept |
| void | set_cutoff_hz (double cutoff_hz) noexcept |
| Crossfeed low-pass cutoff. | |
| double | cutoff_hz () const noexcept |
| int | tail_samples () const noexcept |
| The one-pole feed decays asymptotically whenever crossfeed is active. | |
| void | reset () noexcept |
| void | process_sample (SampleType input_left, SampleType input_right, SampleType &output_left, SampleType &output_right) noexcept |
| void | process_block (const SampleType *input_left, const SampleType *input_right, SampleType *output_left, SampleType *output_right, std::size_t sample_count) noexcept |
Static Public Member Functions | |
| static constexpr int | latency_samples () noexcept |
| Exact zero algorithmic latency: only the opposite-channel contribution is delayed; the direct paths are not delayed. | |
Static Public Attributes | |
| static constexpr double | kMinimumSampleRate = 1000.0 |
| static constexpr double | kMaximumSampleRate = 768000.0 |
| static constexpr double | kMaximumDelayMs = 1.0 |
| static constexpr double | kMaximumCrossfeedGain = 0.35 |
Mixes a delayed, low-pass-filtered copy of each channel into the opposite ear.
The topology is a stable feed-forward path: there is no feedback and the one-pole filter coefficient is always in [0, 1).
prepare() and setters belong on the control thread. process_sample(), process_block(), and reset() are bounded, lock-free, and allocation-free.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
Exact zero algorithmic latency: only the opposite-channel contribution is delayed; the direct paths are not delayed.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Normalized crossfeed amount.
At one, the opposite-channel feed is kMaximumCrossfeedGain before unity-at-DC normalization.
|
inlinenoexcept |
Crossfeed low-pass cutoff.
The requested value is clamped to [100, 20000] Hz and the effective value to 45% of sample rate.
|
inlinenoexcept |
Interaural delay in milliseconds, clamped to [0, 1].
|
inlinenoexcept |
|
inlinenoexcept |
The one-pole feed decays asymptotically whenever crossfeed is active.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |