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

The key of a dynamics processor as it is listened to: late by the processor's latency and held under full scale. More...

#include <KeyEqualizer.h>

Public Member Functions

void prepare (double sampleRate, int maxDelaySamples) noexcept
 Sets the rate and the longest delay (allocates).
 
void reset () noexcept
 Clears the delay and lets the gain go.
 
void processFrame (T *frame, int channels, int delay) noexcept
 One frame: the key of every channel goes in and comes out late and under the ceiling.
 

Static Public Attributes

static constexpr double kCeiling = 1.0
 Largest sample that goes out.
 
static constexpr double kReleaseSeconds = 0.1
 Time constant of the gain's return.
 

Detailed Description

template<FloatType T, int MaxChannels = 16>
class dspark::KeyMonitor< T, MaxChannels >

The key of a dynamics processor as it is listened to: late by the processor's latency and held under full scale.

A processor that plays its key instead of its output, so that the sidechain can be tuned by ear, should leave the track where it is: the key goes out late by the latency the processor reports, and switching the listen on does not move it against the rest of the mix. An equalized key can also be far louder than the programme (a bell of +24 dB on a full mix): the monitor keeps it under a ceiling with one gain for all the channels, which falls at once when a peak comes and returns over kReleaseSeconds. Under the ceiling and with no delay the key goes out as it came, to the bit.

Threading: prepare() on the setup thread (it allocates and never throws: without memory the key is not delayed); the rest on the audio thread.

Template Parameters
TSample type (float or double).
MaxChannelsLargest number of key channels.

Definition at line 891 of file KeyEqualizer.h.

Member Function Documentation

◆ prepare()

template<FloatType T, int MaxChannels = 16>
void dspark::KeyMonitor< T, MaxChannels >::prepare ( double  sampleRate,
int  maxDelaySamples 
)
inlinenoexcept

Sets the rate and the longest delay (allocates).

Parameters
sampleRateRate in hertz (invalid values leave the monitor as it was).
maxDelaySamplesLongest delay the key will be given.

Definition at line 902 of file KeyEqualizer.h.

◆ processFrame()

template<FloatType T, int MaxChannels = 16>
void dspark::KeyMonitor< T, MaxChannels >::processFrame ( T *  frame,
int  channels,
int  delay 
)
inlinenoexcept

One frame: the key of every channel goes in and comes out late and under the ceiling.

Parameters
frameThe key of each channel, replaced in place.
channelsChannels in the frame (those over MaxChannels are left alone).
delaySamples the key is held back (up to the delay given to prepare()).

Definition at line 928 of file KeyEqualizer.h.

◆ reset()

template<FloatType T, int MaxChannels = 16>
void dspark::KeyMonitor< T, MaxChannels >::reset ( )
inlinenoexcept

Clears the delay and lets the gain go.

Definition at line 914 of file KeyEqualizer.h.

Member Data Documentation

◆ kCeiling

template<FloatType T, int MaxChannels = 16>
constexpr double dspark::KeyMonitor< T, MaxChannels >::kCeiling = 1.0
staticconstexpr

Largest sample that goes out.

Definition at line 894 of file KeyEqualizer.h.

◆ kReleaseSeconds

template<FloatType T, int MaxChannels = 16>
constexpr double dspark::KeyMonitor< T, MaxChannels >::kReleaseSeconds = 0.1
staticconstexpr

Time constant of the gain's return.

Definition at line 895 of file KeyEqualizer.h.


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