|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
A loudspeaker cabinet: colour filters, sparse reflections and two diffusers, with no latency. More...
#include <CabinetModel.h>
Public Member Functions | |
| void | prepare (double sampleRate, int numChannels) |
| Prepares the model for a sample rate and a channel count, and clears it. Invalid values are ignored. Allocates; setup thread. | |
| void | reset () noexcept |
| Clears the filters and the reflections (settings are kept). | |
| void | setSize (T size) noexcept |
| Size of the box, 0 to 1: the cone's resonance from 140 Hz (0) down to 70 Hz (1). Default 0.5 (99 Hz). | |
| void | setBrightness (T brightness) noexcept |
| Brightness of the speaker, 0 to 1: the roll-off from 3 kHz (0) up to 7 kHz (1), with the breakup peak at 0.62 of it. Default 0.5. | |
| void | setDistance (T distance) noexcept |
| Distance of the microphone, 0 to 1: how much of the box's reflections comes with the direct sound (0: none). Default 0.3. | |
| T | getSize () const noexcept |
| T | getBrightness () const noexcept |
| T | getDistance () const noexcept |
| double | getResonanceHz () const noexcept |
| The cone's resonance for the size set, in hertz. | |
| double | getRollOffHz () const noexcept |
| The roll-off corner for the brightness set, in hertz. | |
| void | writeState (StateWriter &w, const char *prefix) const |
| Writes the settings under keys that start with a prefix. | |
| void | readState (const StateReader &r, const char *prefix) noexcept |
| Reads what writeState() wrote (missing keys read as the defaults). | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Runs a block in place. Channels beyond the prepared count pass through. | |
Static Public Attributes | |
| static constexpr int | kTaps = 6 |
| Reflections of the box. | |
| static constexpr int | kSections = 5 |
| Sections of the colour filters. | |
A loudspeaker cabinet: colour filters, sparse reflections and two diffusers, with no latency.
| T | Sample type (float or double). |
| MaxChannels | Largest number of channels. |
Definition at line 72 of file CabinetModel.h.
|
inlinenoexcept |
Definition at line 146 of file CabinetModel.h.
|
inlinenoexcept |
Definition at line 147 of file CabinetModel.h.
|
inlinenoexcept |
The cone's resonance for the size set, in hertz.
Definition at line 150 of file CabinetModel.h.
|
inlinenoexcept |
The roll-off corner for the brightness set, in hertz.
Definition at line 152 of file CabinetModel.h.
|
inlinenoexcept |
Definition at line 145 of file CabinetModel.h.
|
inline |
Prepares the model for a sample rate and a channel count, and clears it. Invalid values are ignored. Allocates; setup thread.
Definition at line 82 of file CabinetModel.h.
|
inlinenoexcept |
Runs a block in place. Channels beyond the prepared count pass through.
Definition at line 182 of file CabinetModel.h.
|
inlinenoexcept |
Reads what writeState() wrote (missing keys read as the defaults).
Definition at line 170 of file CabinetModel.h.
|
inlinenoexcept |
Clears the filters and the reflections (settings are kept).
Definition at line 107 of file CabinetModel.h.
|
inlinenoexcept |
Brightness of the speaker, 0 to 1: the roll-off from 3 kHz (0) up to 7 kHz (1), with the breakup peak at 0.62 of it. Default 0.5.
Definition at line 129 of file CabinetModel.h.
|
inlinenoexcept |
Distance of the microphone, 0 to 1: how much of the box's reflections comes with the direct sound (0: none). Default 0.3.
Definition at line 139 of file CabinetModel.h.
|
inlinenoexcept |
Size of the box, 0 to 1: the cone's resonance from 140 Hz (0) down to 70 Hz (1). Default 0.5 (99 Hz).
Definition at line 119 of file CabinetModel.h.
|
inline |
Writes the settings under keys that start with a prefix.
Definition at line 158 of file CabinetModel.h.
|
staticconstexpr |
Sections of the colour filters.
Definition at line 76 of file CabinetModel.h.
|
staticconstexpr |
Reflections of the box.
Definition at line 75 of file CabinetModel.h.