Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TransientShaper Class Reference

Transient shaper - independent control over attack and sustain. More...

#include <gin_transientshaper.h>

Public Member Functions

 TransientShaper ()=default
 
 ~TransientShaper ()=default
 
void setSampleRate (double sr)
 
void setAttack (float a)
 Attack shaping, -4 to +4.
 
void setSustain (float s)
 Sustain shaping, -8 to +8.
 
void setDetectorBalance (float b)
 What the detector listens to: 0 is mid only, 0.5 both, 1 side only.
 
void setProcessBalance (float b)
 Where the gain is applied: 0 is mid only, 0.5 both, 1 side only.
 
void setBand (float lowCutHz, float highCutHz)
 Restricts shaping to a band.
 
void setSmoothing (float s)
 Gain smoothing, 0 (snappy, 10 kHz) to 1 (smooth, 0.1 Hz).
 
void setOutputGain (float db)
 
void reset ()
 
void process (juce::AudioSampleBuffer &buffer)
 

Detailed Description

Transient shaper - independent control over attack and sustain.

Unlike a compressor, there is no threshold. The gain comes from the ratio between three envelope followers running on the same detector signal: a fast one (100 Hz), a baseline (10 Hz) and a slow one (1 Hz). When the fast envelope runs ahead of the baseline the signal is in its attack; when the slow one sits above the baseline it is in its tail. Because both are ratios, the effect is level independent - it works the same on a quiet drum loop as on a hot one, with nothing to re-tune as the source changes.

Positive attack sharpens transients, negative softens them. Positive sustain lengthens the tail, negative shortens it - a quick way to dry out an over-reverberant room mic.

Key Features:

Usage:

shaper.setSampleRate (44100.0);
shaper.setAttack (2.0f); // sharpen the attack
shaper.setSustain (-1.0f); // and dry out the tail
shaper.process (buffer); // stereo, in place
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
Transient shaper - independent control over attack and sustain.
Definition gin_transientshaper.h:59

Note: stereo only - process() expects a two channel buffer.

See also
Dynamics, Maximizer

Constructor & Destructor Documentation

◆ TransientShaper()

TransientShaper::TransientShaper ( )
default

◆ ~TransientShaper()

TransientShaper::~TransientShaper ( )
default

Member Function Documentation

◆ setSampleRate()

void TransientShaper::setSampleRate ( double  sr)

References reset().

◆ setAttack()

void TransientShaper::setAttack ( float  a)

Attack shaping, -4 to +4.

Positive sharpens, negative softens, 0 is neutral.

◆ setSustain()

void TransientShaper::setSustain ( float  s)

Sustain shaping, -8 to +8.

Positive lengthens the tail, negative shortens it.

◆ setDetectorBalance()

void TransientShaper::setDetectorBalance ( float  b)

What the detector listens to: 0 is mid only, 0.5 both, 1 side only.

◆ setProcessBalance()

void TransientShaper::setProcessBalance ( float  b)

Where the gain is applied: 0 is mid only, 0.5 both, 1 side only.

◆ setBand()

void TransientShaper::setBand ( float  lowCutHz,
float  highCutHz 
)

Restricts shaping to a band.

Everything outside it is passed through dry and unshaped, so a 40-200 Hz band shapes the kick and leaves the rest of the mix alone.

Parameters
lowCutHzbottom of the shaped band, 0 for no low cut
highCutHztop of the shaped band, 0 or >= nyquist for none

◆ setSmoothing()

void TransientShaper::setSmoothing ( float  s)

Gain smoothing, 0 (snappy, 10 kHz) to 1 (smooth, 0.1 Hz).

◆ setOutputGain()

void TransientShaper::setOutputGain ( float  db)

◆ reset()

void TransientShaper::reset ( )

References Biquad::reset().

Referenced by setSampleRate().

◆ process()

void TransientShaper::process ( juce::AudioSampleBuffer &  buffer)

References Biquad::process().


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