|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
Multi-band saturation: crossover split, a Saturation per band, sum. More...
#include <MultibandSaturation.h>
Public Types | |
| using | Crossover = CrossoverFilter< T, MaxBands > |
Public Member Functions | |
| MultibandSaturation () | |
| MultibandSaturation (const MultibandSaturation &)=delete | |
| MultibandSaturation & | operator= (const MultibandSaturation &)=delete |
| void | prepare (const AudioSpec &spec) |
| Prepares the crossover, every band and the buffers. | |
| void | reset () noexcept |
| Clears the crossover, the bands and the alignment delays. | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Processes audio through the bands, in place. | |
| void | setNumBands (int n) noexcept |
| Number of bands (2..MaxBands; any thread; re-spaces the split frequencies; a live change fades, see CrossoverFilter::setNumBands()). | |
| void | setNumBandsKeepingSplits (int n) noexcept |
| Number of bands keeping the split frequencies (any thread; see CrossoverFilter::setNumBandsKeepingSplits()). | |
| void | setCrossoverFrequency (int index, T hz) noexcept |
| Sets a split frequency (any thread). | |
| void | setOrder (int order) noexcept |
| Slope of the crossover in dB per octave (any thread; see CrossoverFilter::setOrder()). | |
| void | setCrossoverMode (typename Crossover::FilterMode mode) noexcept |
| Minimum-phase (IIR) or linear-phase crossover (any thread; see CrossoverFilter). | |
| void | setCrossoverStructure (typename Crossover::Structure structure) noexcept |
| Direct-form or ladder sections in the minimum-phase crossover (any thread; see CrossoverFilter::setStructure()). | |
| void | setCrossoverTopology (typename Crossover::Topology topology) noexcept |
| Cascade or balanced arrangement of the minimum-phase splits (any thread; see CrossoverFilter::setTopology()). | |
| int | getNumBands () const noexcept |
| T | getCrossoverFrequency (int index) const noexcept |
| int | getOrder () const noexcept |
| Crossover::FilterMode | getCrossoverMode () const noexcept |
| Crossover::Structure | getCrossoverStructure () const noexcept |
| Crossover::Topology | getCrossoverTopology () const noexcept |
| Saturation< T > & | getBandSaturation (int band) noexcept |
| The Saturation of a band (the index is clamped). | |
| const Saturation< T > & | getBandSaturation (int band) const noexcept |
| The Saturation of a band (the index is clamped). | |
| void | setBandAlgorithm (int band, typename Saturation< T >::Algorithm algo) |
| The algorithm of a band (any thread). | |
| void | setBandDrive (int band, T dB) |
| The drive of a band in dB (any thread). | |
| void | setBandLevel (int band, T dB) noexcept |
| Level of a band in dB, -60 to +24 (any thread; glides over 20 ms). | |
| void | setBandPan (int band, T pan) noexcept |
| Pan of a band, -1 (left) to +1 (right); a balance that never lifts a side (any thread). | |
| void | setBandMute (int band, bool on) noexcept |
| Mutes a band (any thread; fades over 20 ms). | |
| void | setBandSolo (int band, bool on) noexcept |
| Solos a band: while any band is soloed only the soloed ones are heard (any thread; fades over 20 ms). | |
| T | getBandLevel (int band) const noexcept |
| T | getBandPan (int band) const noexcept |
| bool | isBandMuted (int band) const noexcept |
| bool | isBandSoloed (int band) const noexcept |
| bool | isBandComputed (int band) const noexcept |
| Whether a band is computed now (false while it is not heard; audio-thread state). | |
| void | setMix (T amount) noexcept |
| Blends the sum of the bands with the programme, 0 (dry) to 1 (the default: the bands alone; any thread; glides over 20 ms). | |
| T | getMix () const noexcept |
| void | setOutputClip (bool on) noexcept |
| An oversampled clipper after the sum (off by default; any thread). | |
| bool | getOutputClip () const noexcept |
| void | setOutputCeiling (T dB) noexcept |
| Ceiling of the output clipper, -24 to 0 dBFS (default 0; any thread). | |
| T | getOutputCeiling () const noexcept |
| void | setOversampling (int factor) |
| The oversampling factor of every band (NOT real-time safe; see Saturation::setOversampling()). | |
| void | setOversamplingMode (typename Saturation< T >::OversamplingMode mode) |
| The oversampler filters of every band (NOT real-time safe). | |
| void | setOversamplingBand (typename Saturation< T >::OversamplingBand band) |
| The band the first stage of every band's oversampler keeps (NOT real-time safe; see Saturation::setOversamplingBand()). | |
| void | setAntialiasing (typename Saturation< T >::Antialiasing mode) noexcept |
| The antialiasing order of every band. | |
| int | getLatency () const noexcept |
| Latency in samples: the crossover's and the slowest band's. | |
| std::vector< uint8_t > | getState () const |
| Serializes the crossover, each band's Saturation and its level, pan, mute and solo. | |
| bool | setState (const uint8_t *data, size_t size) |
| Restores what getState() wrote (setup thread: the bands may reallocate). | |
Multi-band saturation: crossover split, a Saturation per band, sum.
| T | Sample type (float or double). |
| MaxBands | Maximum number of bands (compile-time, default 6). |
Definition at line 83 of file MultibandSaturation.h.
| using dspark::MultibandSaturation< T, MaxBands >::Crossover = CrossoverFilter<T, MaxBands> |
Definition at line 88 of file MultibandSaturation.h.
|
inline |
Definition at line 90 of file MultibandSaturation.h.
|
delete |
|
inlinenoexcept |
Definition at line 238 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 239 of file MultibandSaturation.h.
|
inlinenoexcept |
The Saturation of a band (the index is clamped).
Definition at line 203 of file MultibandSaturation.h.
|
inlinenoexcept |
The Saturation of a band (the index is clamped).
Definition at line 198 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 189 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 191 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 192 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 193 of file MultibandSaturation.h.
|
inlinenoexcept |
Latency in samples: the crossover's and the slowest band's.
Every band is delayed to the slowest band's latency, so this is the latency of the sum whatever each band runs with; the output clipper adds its own while it is on.
Definition at line 323 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 269 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 188 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 190 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 290 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 281 of file MultibandSaturation.h.
|
inline |
Serializes the crossover, each band's Saturation and its level, pan, mute and solo.
Definition at line 332 of file MultibandSaturation.h.
|
inlinenoexcept |
Whether a band is computed now (false while it is not heard; audio-thread state).
Definition at line 244 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 240 of file MultibandSaturation.h.
|
inlinenoexcept |
Definition at line 241 of file MultibandSaturation.h.
|
delete |
|
inline |
Prepares the crossover, every band and the buffers.
Invalid specs are ignored. May allocate; setup thread only.
| spec | The audio specification (sample rate, max block size, channels). |
Definition at line 107 of file MultibandSaturation.h.
|
inlinenoexcept |
Processes audio through the bands, in place.
Pass-through until prepare() succeeds. A block longer than the prepared maxBlockSize is processed in pieces of that size; channels beyond the prepared count pass through.
Definition at line 161 of file MultibandSaturation.h.
|
inlinenoexcept |
Clears the crossover, the bands and the alignment delays.
Definition at line 133 of file MultibandSaturation.h.
|
inlinenoexcept |
The antialiasing order of every band.
Definition at line 311 of file MultibandSaturation.h.
|
inline |
The algorithm of a band (any thread).
Definition at line 209 of file MultibandSaturation.h.
|
inline |
The drive of a band in dB (any thread).
Definition at line 211 of file MultibandSaturation.h.
|
inlinenoexcept |
Level of a band in dB, -60 to +24 (any thread; glides over 20 ms).
Definition at line 214 of file MultibandSaturation.h.
|
inlinenoexcept |
Mutes a band (any thread; fades over 20 ms).
Definition at line 226 of file MultibandSaturation.h.
|
inlinenoexcept |
Pan of a band, -1 (left) to +1 (right); a balance that never lifts a side (any thread).
Definition at line 220 of file MultibandSaturation.h.
|
inlinenoexcept |
Solos a band: while any band is soloed only the soloed ones are heard (any thread; fades over 20 ms).
Definition at line 232 of file MultibandSaturation.h.
|
inlinenoexcept |
Sets a split frequency (any thread).
Definition at line 178 of file MultibandSaturation.h.
|
inlinenoexcept |
Minimum-phase (IIR) or linear-phase crossover (any thread; see CrossoverFilter).
Definition at line 182 of file MultibandSaturation.h.
|
inlinenoexcept |
Direct-form or ladder sections in the minimum-phase crossover (any thread; see CrossoverFilter::setStructure()).
Definition at line 184 of file MultibandSaturation.h.
|
inlinenoexcept |
Cascade or balanced arrangement of the minimum-phase splits (any thread; see CrossoverFilter::setTopology()).
Definition at line 186 of file MultibandSaturation.h.
|
inlinenoexcept |
Blends the sum of the bands with the programme, 0 (dry) to 1 (the default: the bands alone; any thread; glides over 20 ms).
The dry side is the programme as the crossover leaves it (the bands summed without their curves) and as late as the slowest band, so it meets the processed bands in the crossover's phase: with no drive a mix of one half is as flat as the crossover is, at the splits too. Each band's dry side crosses what that band's does: the filters of minimum-phase oversampling, and between the two ends the phase (not the magnitude) of its Saturation's high-passes, so a mix of one half is the mean of the two levels at the bottom and at the top as well. Each band's own Saturation mix still acts inside its band.
Definition at line 265 of file MultibandSaturation.h.
|
inlinenoexcept |
Number of bands (2..MaxBands; any thread; re-spaces the split frequencies; a live change fades, see CrossoverFilter::setNumBands()).
Definition at line 174 of file MultibandSaturation.h.
|
inlinenoexcept |
Number of bands keeping the split frequencies (any thread; see CrossoverFilter::setNumBandsKeepingSplits()).
Definition at line 176 of file MultibandSaturation.h.
|
inlinenoexcept |
Slope of the crossover in dB per octave (any thread; see CrossoverFilter::setOrder()).
Definition at line 180 of file MultibandSaturation.h.
|
inlinenoexcept |
Ceiling of the output clipper, -24 to 0 dBFS (default 0; any thread).
Definition at line 284 of file MultibandSaturation.h.
|
inlinenoexcept |
An oversampled clipper after the sum (off by default; any thread).
Driven bands add up to more than any one of them (six bands at their ceilings sum to several times full scale). With this on, the sum is clipped at setOutputCeiling() four times oversampled, and no sample leaves over the ceiling; under it nothing changes but the latency, which grows by the clipper's (getLatency() reports it).
Definition at line 280 of file MultibandSaturation.h.
|
inline |
The oversampling factor of every band (NOT real-time safe; see Saturation::setOversampling()).
Definition at line 295 of file MultibandSaturation.h.
|
inline |
The band the first stage of every band's oversampler keeps (NOT real-time safe; see Saturation::setOversamplingBand()).
Definition at line 306 of file MultibandSaturation.h.
|
inline |
The oversampler filters of every band (NOT real-time safe).
Definition at line 300 of file MultibandSaturation.h.
|
inline |
Restores what getState() wrote (setup thread: the bands may reallocate).
Definition at line 367 of file MultibandSaturation.h.