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

Simple gain processor with ramping to avoid discontinuities. More...

#include <gin_audioutil.h>

Public Member Functions

void setGain (float g)
 
void reset ()
 
void process (juce::AudioSampleBuffer &buffer)
 

Detailed Description

Simple gain processor with ramping to avoid discontinuities.

GainProcessor applies gain to an audio buffer with automatic ramping between gain values to prevent clicks and pops. It maintains the previous gain value and applies a linear ramp when the gain changes.

Key Features:

Usage:

gainProc.setGain(0.5f); // Set to 50% volume
// In audio callback
gainProc.process(audioBuffer); // Applies gain with ramping
// When starting a new voice/note
gainProc.reset(); // Snap to current gain without ramping
Simple gain processor with ramping to avoid discontinuities.
Definition gin_audioutil.h:89
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25

Note: Gain ramping occurs over the entire buffer length. For longer buffers, this provides smoother transitions. For per-sample control, consider juce::LinearSmoothedValue instead.

See also
juce::LinearSmoothedValue, applyGain

Member Function Documentation

◆ setGain()

void GainProcessor::setGain ( float  g)

◆ reset()

void GainProcessor::reset ( )

◆ process()

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

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