DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::ResonanceSuppressor< T > Class Template Reference

Dynamic suppression of resonances by a minimum-phase filter on a log-frequency grid. More...

#include <ResonanceSuppressor.h>

Public Types

enum class  Mode { Smooth , Deep }
 
enum class  Link { PerBin , MidSide }
 
enum class  Quality { Realtime , Offline }
 
using Band = typename KeyEqualizer< T, 2 >::Band
 

Public Member Functions

void prepare (const AudioSpec &spec)
 Allocates for a rate and a layout (an invalid spec is ignored).
 
void reset () noexcept
 Clears the analysis and the filter.
 
void setDetail (T octaves) noexcept
 The detail: how narrow what is found and cut is, from an octave to 1/24 of one (default 1/12). It moves while playing, at the same latency.
 
void setThreshold (T db) noexcept
 Over the loudest of its neighbours by this much a peak is a resonance, 0 to 30 dB (default 5).
 
void setStrength (T amount) noexcept
 How much of what passes the threshold is taken out, 0 to 1 (default 1).
 
void setRange (T db) noexcept
 Largest reduction, 0 to 48 dB (default 9; Mode::Deep reaches half as far again).
 
void setWidth (T octaves) noexcept
 How far the neighbours a peak is compared with reach, in octaves beyond the detail, 0.05 to 4 (default 1/3). A side with no peak that near is read on to the next partial of a note.
 
void setAttack (T ms) noexcept
 Attack at 1 kHz, 0.5 to 500 ms (default 5; slower below, faster above, by the square root of the frequency).
 
void setRelease (T ms) noexcept
 Release at 1 kHz, 5 to 2000 ms (default 80).
 
void setMode (Mode m) noexcept
 Smooth (the default) works at the detail set and takes what stands over the loudest of its neighbours. Deep is more of both, detail and strength: it reads and cuts in half the detail (to 1/24 of an octave at the finest), takes both of two resonances closer than the detail and what stands over the mean of its peers, and takes up to half as deep again, setRange() included (under about 150 Hz no narrower, and as little as a fifth deeper).
 
void setFoundationGuard (T amount) noexcept
 How far what carries the programme from under it is spared, 0 to 1 (default 1): what is within 6 dB of the loudest with nothing within 20 dB underneath, like a sub bass, is then not taken under 70 Hz and by more as it rises, whole from 320 Hz. At 0 it is a resonance like any other, as deep in the low end as at the top. The same in both modes. Non-finite values are ignored.
 
void setLinkMode (Link l) noexcept
 Stereo handling (PerBin by default).
 
void setLink (T amount) noexcept
 Per-point link, 0 (each channel its own) to 1 (one detector and filter), default 1.
 
void setSideWeight (T share) noexcept
 In MidSide, the side's reduction as a share of the mid's, 0 to 2 (default 1).
 
void setRemovalListen (bool on) noexcept
 Outputs what is taken out.
 
void setFocusListen (bool on) noexcept
 Outputs the programme through the sensitivity curve.
 
void setMix (T amount) noexcept
 How much of the filter is applied, 0 to 1 (default 1). The mix is taken inside the filter: its gain becomes 1 - mix + mix * gain before the minimum-phase filter is designed, so the part left alone and the part reduced never meet in two phases.
 
void setKnee (T db) noexcept
 Soft knee at the threshold, 0 to 12 dB (0, the default, is the hard knee): the reduction grows smoothly on both sides of the threshold, so a resonance that hovers at it moves less from frame to frame.
 
void setPersistence (T ms) noexcept
 Persistence, 0 to 500 ms (default 50; 0 counts at once): how long a resonance lasts before it counts, not at all until half of it has gone by and whole half of it later, however loud. A click, a consonant or the attack of a drum are over before they weigh.
 
void setQuietLevel (T dbfs) noexcept
 Level under which the suppressor lets go, -120 to 0 dBFS (off at -200, the default; anything under -190 turns it off). Each point is read as its amplitude plus this level, so what lies well over it is treated as before and what lies under it shows no resonance: quiet passages, tails and the noise of a room are left alone.
 
void setAuditoryWeighting (bool on) noexcept
 Weighs the amount by how well the ear hears each frequency (off by default): a third of the distance in dB from the threshold of hearing in quiet to its lowest point comes off the weight, so the same excess weighs at 150 Hz under half of what it does at 3 kHz.
 
void setWidthTaper (T cornerHz, T exponent) noexcept
 Narrows setWidth() above a corner: it falls as (corner / frequency) to the exponent (0, the default, keeps it everywhere; 1 keeps it constant in hertz above the corner). Non-finite values are ignored.
 
void setRemovalBand (T lowHz, T highHz) noexcept
 The band setRemovalListen() plays, in hertz (0 and 0, the default, play all of it): what is taken out between the two frequencies alone, with a sixth of an octave of slope at each end. A listening aid like the listen itself: not part of the state. Non-finite values are ignored.
 
void setQuality (Quality q) noexcept
 Realtime reads the long windows of the low end in turns, every two or four hops; Offline reads all of them every hop, for a render (applies at the next prepare(); the same latency).
 
void setQualityFollowsRender (bool on) noexcept
 With it on, a prepare() made while the host renders offline takes the Offline quality whatever setQuality() says (off by default): a bounce is made at the best quality with no setting to remember. The latency is the same in both.
 
void setOfflineRendering (bool on) noexcept
 Tells the suppressor whether the host renders offline (read by the next prepare(); a plugin forwards its host's notice here before it prepares).
 
void setSensitivityBand (int index, const Band &band) noexcept
 One band of the sensitivity curve (KeyEqualizer bands; the curve is a weight, its gain in dB / 12 + 1, clamped 0 to 2).
 
T getDetail () const noexcept
 
void setShortKernel (bool on) noexcept
 Plays kernels of half their transform, tapered over their whole length (off by default; see DetailFilter::setShortKernel()): a cut rings for a shorter time after the event, at the same depth.
 
bool getShortKernel () const noexcept
 
T getThreshold () const noexcept
 
T getStrength () const noexcept
 
T getRange () const noexcept
 
T getWidth () const noexcept
 
T getAttack () const noexcept
 
T getRelease () const noexcept
 
Mode getMode () const noexcept
 
Link getLinkMode () const noexcept
 
T getFoundationGuard () const noexcept
 
T getLink () const noexcept
 
T getSideWeight () const noexcept
 
bool getRemovalListen () const noexcept
 
bool getFocusListen () const noexcept
 
Quality getQuality () const noexcept
 
bool getQualityFollowsRender () const noexcept
 
Quality getQualityInUse () const noexcept
 
T getMix () const noexcept
 
T getKnee () const noexcept
 
T getPersistence () const noexcept
 
T getQuietLevel () const noexcept
 
bool getAuditoryWeighting () const noexcept
 
T getWidthTaperCorner () const noexcept
 
T getWidthTaperExponent () const noexcept
 
T getRemovalBandLow () const noexcept
 
T getRemovalBandHigh () const noexcept
 
Band getSensitivityBand (int index) const noexcept
 
int getLatency () const noexcept
 
T getReduction (double hz) const noexcept
 
T getDisplayReduction (int channel, int point) const noexcept
 
T getDisplayExcess (int channel, int point) const noexcept
 
T getPeakReduction () const noexcept
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes the programme in place, detecting on itself.
 
void processBlock (AudioBufferView< T > buffer, AudioBufferView< T > key) noexcept
 Processes the programme in place, detecting on a key (same length).
 
std::vector< uint8_t > getState () const
 
bool setState (const uint8_t *data, size_t size)
 Restores the settings. A blob of the first version (threshold and strength over the mean of the spectrum, where 3 dB and 0.7 were the defaults) is moved onto this one's scale.
 

Static Public Member Functions

static double getDisplayFrequency (int point) noexcept
 

Static Public Attributes

static constexpr int kSensitivityBands = 6
 
static constexpr int kDisplayPoints = SpectralReadout<T>::kPoints
 Points of the display curves, evenly in log frequency from 20 Hz to 20 kHz.
 

Detailed Description

template<FloatType T>
class dspark::ResonanceSuppressor< T >

Dynamic suppression of resonances by a minimum-phase filter on a log-frequency grid.

Template Parameters
TSample type (float or double).

Definition at line 97 of file ResonanceSuppressor.h.

Member Typedef Documentation

◆ Band

template<FloatType T>
using dspark::ResonanceSuppressor< T >::Band = typename KeyEqualizer<T, 2>::Band

Definition at line 104 of file ResonanceSuppressor.h.

Member Enumeration Documentation

◆ Link

template<FloatType T>
enum class dspark::ResonanceSuppressor::Link
strong
Enumerator
PerBin 
MidSide 

Definition at line 101 of file ResonanceSuppressor.h.

◆ Mode

template<FloatType T>
enum class dspark::ResonanceSuppressor::Mode
strong
Enumerator
Smooth 
Deep 

Definition at line 100 of file ResonanceSuppressor.h.

◆ Quality

template<FloatType T>
enum class dspark::ResonanceSuppressor::Quality
strong
Enumerator
Realtime 
Offline 

Definition at line 102 of file ResonanceSuppressor.h.

Member Function Documentation

◆ getAttack()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getAttack ( ) const
inlinenoexcept

Definition at line 329 of file ResonanceSuppressor.h.

◆ getAuditoryWeighting()

template<FloatType T>
bool dspark::ResonanceSuppressor< T >::getAuditoryWeighting ( ) const
inlinenoexcept

Definition at line 346 of file ResonanceSuppressor.h.

◆ getDetail()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getDetail ( ) const
inlinenoexcept

Definition at line 315 of file ResonanceSuppressor.h.

◆ getDisplayExcess()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getDisplayExcess ( int  channel,
int  point 
) const
inlinenoexcept
Returns
What the last frame found to be a resonance at a display point: what passes the threshold, weighted by the sensitivity curve and held by the persistence, in dB (0 or more), before setStrength() and setRange(). Any thread.

Definition at line 382 of file ResonanceSuppressor.h.

◆ getDisplayFrequency()

template<FloatType T>
static double dspark::ResonanceSuppressor< T >::getDisplayFrequency ( int  point)
inlinestaticnoexcept
Returns
The frequency of a display point, in hertz.

Definition at line 366 of file ResonanceSuppressor.h.

◆ getDisplayReduction()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getDisplayReduction ( int  channel,
int  point 
) const
inlinenoexcept
Returns
The reduction applied at a display point, in dB (0 or less): the response of the kernels handed over every 21 ms, made by the first read after they change. Channel 0 and 1 (the mid and the side with Link::MidSide); a linked pair shows the same curve on both. With setFocusListen(true), the gain of the focus filter. Any thread.

Definition at line 375 of file ResonanceSuppressor.h.

◆ getFocusListen()

template<FloatType T>
bool dspark::ResonanceSuppressor< T >::getFocusListen ( ) const
inlinenoexcept

Definition at line 337 of file ResonanceSuppressor.h.

◆ getFoundationGuard()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getFoundationGuard ( ) const
inlinenoexcept

Definition at line 333 of file ResonanceSuppressor.h.

◆ getKnee()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getKnee ( ) const
inlinenoexcept

Definition at line 343 of file ResonanceSuppressor.h.

◆ getLatency()

template<FloatType T>
int dspark::ResonanceSuppressor< T >::getLatency ( ) const
inlinenoexcept
Returns
The latency in samples.

Definition at line 353 of file ResonanceSuppressor.h.

◆ getLink()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getLink ( ) const
inlinenoexcept

Definition at line 334 of file ResonanceSuppressor.h.

◆ getLinkMode()

template<FloatType T>
Link dspark::ResonanceSuppressor< T >::getLinkMode ( ) const
inlinenoexcept

Definition at line 332 of file ResonanceSuppressor.h.

◆ getMix()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getMix ( ) const
inlinenoexcept

Definition at line 342 of file ResonanceSuppressor.h.

◆ getMode()

template<FloatType T>
Mode dspark::ResonanceSuppressor< T >::getMode ( ) const
inlinenoexcept

Definition at line 331 of file ResonanceSuppressor.h.

◆ getPeakReduction()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getPeakReduction ( ) const
inlinenoexcept
Returns
The deepest reduction of that response, on either channel, in dB (any thread).

Definition at line 384 of file ResonanceSuppressor.h.

◆ getPersistence()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getPersistence ( ) const
inlinenoexcept

Definition at line 344 of file ResonanceSuppressor.h.

◆ getQuality()

template<FloatType T>
Quality dspark::ResonanceSuppressor< T >::getQuality ( ) const
inlinenoexcept

Definition at line 338 of file ResonanceSuppressor.h.

◆ getQualityFollowsRender()

template<FloatType T>
bool dspark::ResonanceSuppressor< T >::getQualityFollowsRender ( ) const
inlinenoexcept

Definition at line 339 of file ResonanceSuppressor.h.

◆ getQualityInUse()

template<FloatType T>
Quality dspark::ResonanceSuppressor< T >::getQualityInUse ( ) const
inlinenoexcept
Returns
The quality the last prepare() took (setQuality(), or Offline for an offline render it follows).

Definition at line 341 of file ResonanceSuppressor.h.

◆ getQuietLevel()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getQuietLevel ( ) const
inlinenoexcept

Definition at line 345 of file ResonanceSuppressor.h.

◆ getRange()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getRange ( ) const
inlinenoexcept

Definition at line 327 of file ResonanceSuppressor.h.

◆ getReduction()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getReduction ( double  hz) const
inlinenoexcept
Returns
The reduction of the last frame at a frequency, in dB (audio thread or after processing).

Definition at line 355 of file ResonanceSuppressor.h.

◆ getRelease()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getRelease ( ) const
inlinenoexcept

Definition at line 330 of file ResonanceSuppressor.h.

◆ getRemovalBandHigh()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getRemovalBandHigh ( ) const
inlinenoexcept

Definition at line 350 of file ResonanceSuppressor.h.

◆ getRemovalBandLow()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getRemovalBandLow ( ) const
inlinenoexcept

Definition at line 349 of file ResonanceSuppressor.h.

◆ getRemovalListen()

template<FloatType T>
bool dspark::ResonanceSuppressor< T >::getRemovalListen ( ) const
inlinenoexcept

Definition at line 336 of file ResonanceSuppressor.h.

◆ getSensitivityBand()

template<FloatType T>
Band dspark::ResonanceSuppressor< T >::getSensitivityBand ( int  index) const
inlinenoexcept

Definition at line 351 of file ResonanceSuppressor.h.

◆ getShortKernel()

template<FloatType T>
bool dspark::ResonanceSuppressor< T >::getShortKernel ( ) const
inlinenoexcept
Returns
Whether the kernels are short.

Definition at line 324 of file ResonanceSuppressor.h.

◆ getSideWeight()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getSideWeight ( ) const
inlinenoexcept

Definition at line 335 of file ResonanceSuppressor.h.

◆ getState()

template<FloatType T>
std::vector< uint8_t > dspark::ResonanceSuppressor< T >::getState ( ) const
inline

Definition at line 398 of file ResonanceSuppressor.h.

◆ getStrength()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getStrength ( ) const
inlinenoexcept

Definition at line 326 of file ResonanceSuppressor.h.

◆ getThreshold()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getThreshold ( ) const
inlinenoexcept

Definition at line 325 of file ResonanceSuppressor.h.

◆ getWidth()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getWidth ( ) const
inlinenoexcept

Definition at line 328 of file ResonanceSuppressor.h.

◆ getWidthTaperCorner()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getWidthTaperCorner ( ) const
inlinenoexcept

Definition at line 347 of file ResonanceSuppressor.h.

◆ getWidthTaperExponent()

template<FloatType T>
T dspark::ResonanceSuppressor< T >::getWidthTaperExponent ( ) const
inlinenoexcept

Definition at line 348 of file ResonanceSuppressor.h.

◆ prepare()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::prepare ( const AudioSpec &  spec)
inline

Allocates for a rate and a layout (an invalid spec is ignored).

Definition at line 107 of file ResonanceSuppressor.h.

◆ processBlock() [1/2]

template<FloatType T>
void dspark::ResonanceSuppressor< T >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Processes the programme in place, detecting on itself.

Definition at line 389 of file ResonanceSuppressor.h.

◆ processBlock() [2/2]

template<FloatType T>
void dspark::ResonanceSuppressor< T >::processBlock ( AudioBufferView< T >  buffer,
AudioBufferView< T >  key 
)
inlinenoexcept

Processes the programme in place, detecting on a key (same length).

Definition at line 391 of file ResonanceSuppressor.h.

◆ reset()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::reset ( )
inlinenoexcept

Clears the analysis and the filter.

Definition at line 154 of file ResonanceSuppressor.h.

◆ setAttack()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setAttack ( T  ms)
inlinenoexcept

Attack at 1 kHz, 0.5 to 500 ms (default 5; slower below, faster above, by the square root of the frequency).

Definition at line 185 of file ResonanceSuppressor.h.

◆ setAuditoryWeighting()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setAuditoryWeighting ( bool  on)
inlinenoexcept

Weighs the amount by how well the ear hears each frequency (off by default): a third of the distance in dB from the threshold of hearing in quiet to its lowest point comes off the weight, so the same excess weighs at 150 Hz under half of what it does at 3 kHz.

Definition at line 258 of file ResonanceSuppressor.h.

◆ setDetail()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setDetail ( T  octaves)
inlinenoexcept

The detail: how narrow what is found and cut is, from an octave to 1/24 of one (default 1/12). It moves while playing, at the same latency.

Definition at line 171 of file ResonanceSuppressor.h.

◆ setFocusListen()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setFocusListen ( bool  on)
inlinenoexcept

Outputs the programme through the sensitivity curve.

Definition at line 216 of file ResonanceSuppressor.h.

◆ setFoundationGuard()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setFoundationGuard ( T  amount)
inlinenoexcept

How far what carries the programme from under it is spared, 0 to 1 (default 1): what is within 6 dB of the loudest with nothing within 20 dB underneath, like a sub bass, is then not taken under 70 Hz and by more as it rises, whole from 320 Hz. At 0 it is a resonance like any other, as deep in the low end as at the top. The same in both modes. Non-finite values are ignored.

Definition at line 206 of file ResonanceSuppressor.h.

◆ setKnee()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setKnee ( T  db)
inlinenoexcept

Soft knee at the threshold, 0 to 12 dB (0, the default, is the hard knee): the reduction grows smoothly on both sides of the threshold, so a resonance that hovers at it moves less from frame to frame.

Definition at line 230 of file ResonanceSuppressor.h.

◆ setLink()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setLink ( T  amount)
inlinenoexcept

Per-point link, 0 (each channel its own) to 1 (one detector and filter), default 1.

Definition at line 210 of file ResonanceSuppressor.h.

◆ setLinkMode()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setLinkMode ( Link  l)
inlinenoexcept

Stereo handling (PerBin by default).

Definition at line 208 of file ResonanceSuppressor.h.

◆ setMix()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setMix ( T  amount)
inlinenoexcept

How much of the filter is applied, 0 to 1 (default 1). The mix is taken inside the filter: its gain becomes 1 - mix + mix * gain before the minimum-phase filter is designed, so the part left alone and the part reduced never meet in two phases.

Definition at line 223 of file ResonanceSuppressor.h.

◆ setMode()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setMode ( Mode  m)
inlinenoexcept

Smooth (the default) works at the detail set and takes what stands over the loudest of its neighbours. Deep is more of both, detail and strength: it reads and cuts in half the detail (to 1/24 of an octave at the finest), takes both of two resonances closer than the detail and what stands over the mean of its peers, and takes up to half as deep again, setRange() included (under about 150 Hz no narrower, and as little as a fifth deeper).

Definition at line 197 of file ResonanceSuppressor.h.

◆ setOfflineRendering()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setOfflineRendering ( bool  on)
inlinenoexcept

Tells the suppressor whether the host renders offline (read by the next prepare(); a plugin forwards its host's notice here before it prepares).

Definition at line 307 of file ResonanceSuppressor.h.

◆ setPersistence()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setPersistence ( T  ms)
inlinenoexcept

Persistence, 0 to 500 ms (default 50; 0 counts at once): how long a resonance lasts before it counts, not at all until half of it has gone by and whole half of it later, however loud. A click, a consonant or the attack of a drum are over before they weigh.

Definition at line 238 of file ResonanceSuppressor.h.

◆ setQuality()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setQuality ( Quality  q)
inlinenoexcept

Realtime reads the long windows of the low end in turns, every two or four hops; Offline reads all of them every hop, for a render (applies at the next prepare(); the same latency).

Definition at line 294 of file ResonanceSuppressor.h.

◆ setQualityFollowsRender()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setQualityFollowsRender ( bool  on)
inlinenoexcept

With it on, a prepare() made while the host renders offline takes the Offline quality whatever setQuality() says (off by default): a bounce is made at the best quality with no setting to remember. The latency is the same in both.

Definition at line 301 of file ResonanceSuppressor.h.

◆ setQuietLevel()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setQuietLevel ( T  dbfs)
inlinenoexcept

Level under which the suppressor lets go, -120 to 0 dBFS (off at -200, the default; anything under -190 turns it off). Each point is read as its amplitude plus this level, so what lies well over it is treated as before and what lies under it shows no resonance: quiet passages, tails and the noise of a room are left alone.

Definition at line 247 of file ResonanceSuppressor.h.

◆ setRange()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setRange ( T  db)
inlinenoexcept

Largest reduction, 0 to 48 dB (default 9; Mode::Deep reaches half as far again).

Definition at line 177 of file ResonanceSuppressor.h.

◆ setRelease()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setRelease ( T  ms)
inlinenoexcept

Release at 1 kHz, 5 to 2000 ms (default 80).

Definition at line 187 of file ResonanceSuppressor.h.

◆ setRemovalBand()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setRemovalBand ( T  lowHz,
T  highHz 
)
inlinenoexcept

The band setRemovalListen() plays, in hertz (0 and 0, the default, play all of it): what is taken out between the two frequencies alone, with a sixth of an octave of slope at each end. A listening aid like the listen itself: not part of the state. Non-finite values are ignored.

Definition at line 283 of file ResonanceSuppressor.h.

◆ setRemovalListen()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setRemovalListen ( bool  on)
inlinenoexcept

Outputs what is taken out.

Definition at line 214 of file ResonanceSuppressor.h.

◆ setSensitivityBand()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setSensitivityBand ( int  index,
const Band &  band 
)
inlinenoexcept

One band of the sensitivity curve (KeyEqualizer bands; the curve is a weight, its gain in dB / 12 + 1, clamped 0 to 2).

Definition at line 309 of file ResonanceSuppressor.h.

◆ setShortKernel()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setShortKernel ( bool  on)
inlinenoexcept

Plays kernels of half their transform, tapered over their whole length (off by default; see DetailFilter::setShortKernel()): a cut rings for a shorter time after the event, at the same depth.

Definition at line 322 of file ResonanceSuppressor.h.

◆ setSideWeight()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setSideWeight ( T  share)
inlinenoexcept

In MidSide, the side's reduction as a share of the mid's, 0 to 2 (default 1).

Definition at line 212 of file ResonanceSuppressor.h.

◆ setState()

template<FloatType T>
bool dspark::ResonanceSuppressor< T >::setState ( const uint8_t *  data,
size_t  size 
)
inline

Restores the settings. A blob of the first version (threshold and strength over the mean of the spectrum, where 3 dB and 0.7 were the defaults) is moved onto this one's scale.

Definition at line 432 of file ResonanceSuppressor.h.

◆ setStrength()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setStrength ( T  amount)
inlinenoexcept

How much of what passes the threshold is taken out, 0 to 1 (default 1).

Definition at line 175 of file ResonanceSuppressor.h.

◆ setThreshold()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setThreshold ( T  db)
inlinenoexcept

Over the loudest of its neighbours by this much a peak is a resonance, 0 to 30 dB (default 5).

Definition at line 173 of file ResonanceSuppressor.h.

◆ setWidth()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setWidth ( T  octaves)
inlinenoexcept

How far the neighbours a peak is compared with reach, in octaves beyond the detail, 0.05 to 4 (default 1/3). A side with no peak that near is read on to the next partial of a note.

Definition at line 183 of file ResonanceSuppressor.h.

◆ setWidthTaper()

template<FloatType T>
void dspark::ResonanceSuppressor< T >::setWidthTaper ( T  cornerHz,
T  exponent 
)
inlinenoexcept

Narrows setWidth() above a corner: it falls as (corner / frequency) to the exponent (0, the default, keeps it everywhere; 1 keeps it constant in hertz above the corner). Non-finite values are ignored.

Parameters
cornerHzThe corner, 200 Hz to 20 kHz.
exponent0 to 2.

Definition at line 271 of file ResonanceSuppressor.h.

Member Data Documentation

◆ kDisplayPoints

template<FloatType T>
constexpr int dspark::ResonanceSuppressor< T >::kDisplayPoints = SpectralReadout<T>::kPoints
staticconstexpr

Points of the display curves, evenly in log frequency from 20 Hz to 20 kHz.

Definition at line 364 of file ResonanceSuppressor.h.

◆ kSensitivityBands

template<FloatType T>
constexpr int dspark::ResonanceSuppressor< T >::kSensitivityBands = 6
staticconstexpr

Definition at line 103 of file ResonanceSuppressor.h.


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