|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
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 |
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.
|
inlinenoexcept |
Moves the amount by a frame and returns it.
Definition at line 482 of file DryWetMixer.h.
|
inlinenoexcept |
Where the amount goes.
| on | Whether the dry side is turned. |
Definition at line 476 of file DryWetMixer.h.
|
inlinenoexcept |
Puts the amount where it goes, without the fade.
Definition at line 479 of file DryWetMixer.h.
|
inline |
Sizes the state (allocates).
| sampleRate | The rate it runs at. |
| channels | The channels it keeps. |
Definition at line 449 of file DryWetMixer.h.
|
inlinenoexcept |
A stretch of a buffer, in place.
| buffer | The dry side. |
Definition at line 519 of file DryWetMixer.h.
|
inlinenoexcept |
A sample of a channel, with the amount that advance() returned.
| channel | The channel (one that was not prepared passes). |
| x | The dry sample. |
| amount | The amount of this frame. |
Definition at line 496 of file DryWetMixer.h.
|
inlinenoexcept |
Clears the memory (the amount stays).
Definition at line 458 of file DryWetMixer.h.
|
inlinenoexcept |
Moves the corner (a tangent, when it changes).
| hz | The corner in hertz. |
Definition at line 464 of file DryWetMixer.h.
|
staticconstexpr |
The corner for a second-order Butterworth high-pass, over that of the filter.
Definition at line 442 of file DryWetMixer.h.