DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::detail::DryPhase Class Reference

Gives the dry side of a mix the phase that a high-pass leaves in the wet side, and none of its magnitude. More...

#include <DryWetMixer.h>

Public Member Functions

void prepare (double sampleRate, int channels)
 Sizes the state (allocates).
 
void reset () noexcept
 Clears the memory (the amount stays).
 
void setCorner (double hz) noexcept
 Moves the corner (a tangent, when it changes).
 
void aim (bool on) noexcept
 Where the amount goes.
 
void land () noexcept
 Puts the amount where it goes, without the fade.
 
double advance () noexcept
 Moves the amount by a frame and returns it.
 
template<typename T >
T processSample (int channel, T x, double amount) noexcept
 A sample of a channel, with the amount that advance() returned.
 
template<typename T >
void process (AudioBufferView< T > buffer) noexcept
 A stretch of a buffer, in place.
 

Static Public Attributes

static constexpr double kButterworthShare = 0.8
 

Detailed Description

Gives the dry side of a mix the phase that a high-pass leaves in the wet side, and none of its magnitude.

A first-order all-pass that leads: two one-pole high-passes at its corner turn the phase exactly as much, and a second-order Butterworth high-pass within a few degrees of it with the corner at kButterworthShare of its own. A wet side behind such a filter and a dry side without it are a quarter of a turn or more apart at the bottom, and their mix loses there what neither side loses by itself.

It fades in and out over 20 ms (aim()). Faded out it returns its input to the bit, and it goes on following it, so that it starts from where the programme is.

Processing thread, except prepare() (setup thread; allocates).

Definition at line 438 of file DryWetMixer.h.

Member Function Documentation

◆ advance()

double dspark::detail::DryPhase::advance ( )
inlinenoexcept

Moves the amount by a frame and returns it.

Definition at line 482 of file DryWetMixer.h.

◆ aim()

void dspark::detail::DryPhase::aim ( bool  on)
inlinenoexcept

Where the amount goes.

Parameters
onWhether the dry side is turned.

Definition at line 476 of file DryWetMixer.h.

◆ land()

void dspark::detail::DryPhase::land ( )
inlinenoexcept

Puts the amount where it goes, without the fade.

Definition at line 479 of file DryWetMixer.h.

◆ prepare()

void dspark::detail::DryPhase::prepare ( double  sampleRate,
int  channels 
)
inline

Sizes the state (allocates).

Parameters
sampleRateThe rate it runs at.
channelsThe channels it keeps.

Definition at line 449 of file DryWetMixer.h.

◆ process()

template<typename T >
void dspark::detail::DryPhase::process ( AudioBufferView< T >  buffer)
inlinenoexcept

A stretch of a buffer, in place.

Parameters
bufferThe dry side.

Definition at line 519 of file DryWetMixer.h.

◆ processSample()

template<typename T >
T dspark::detail::DryPhase::processSample ( int  channel,
T  x,
double  amount 
)
inlinenoexcept

A sample of a channel, with the amount that advance() returned.

Parameters
channelThe channel (one that was not prepared passes).
xThe dry sample.
amountThe amount of this frame.

Definition at line 496 of file DryWetMixer.h.

◆ reset()

void dspark::detail::DryPhase::reset ( )
inlinenoexcept

Clears the memory (the amount stays).

Definition at line 458 of file DryWetMixer.h.

◆ setCorner()

void dspark::detail::DryPhase::setCorner ( double  hz)
inlinenoexcept

Moves the corner (a tangent, when it changes).

Parameters
hzThe corner in hertz.

Definition at line 464 of file DryWetMixer.h.

Member Data Documentation

◆ kButterworthShare

constexpr double dspark::detail::DryPhase::kButterworthShare = 0.8
staticconstexpr

The corner for a second-order Butterworth high-pass, over that of the filter.

Definition at line 442 of file DryWetMixer.h.


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