TracktionEngine
Loading...
Searching...
No Matches
engine::AudioFadeCurve::CrossfadeLevels Struct Reference

Calculates the two gain multipliers to use for mixing between two sources, given a position alpha from 0 to 1.0. More...

#include <tracktion_AudioFadeCurve.h>

Public Member Functions

 CrossfadeLevels (float alpha) noexcept
 Creates the object and calculates the two gain levels.

Public Attributes

float gain1
float gain2

Detailed Description

Calculates the two gain multipliers to use for mixing between two sources, given a position alpha from 0 to 1.0.

An alpha of 0 will produce gain1 = 1, gain2 = 0. An alpha of 1.0 will produce the opposite, and in-between, the levels will be calculated based on a pair of convex sine curves.

Constructor & Destructor Documentation

◆ CrossfadeLevels()

engine::AudioFadeCurve::CrossfadeLevels::CrossfadeLevels ( float alpha)
noexcept

Creates the object and calculates the two gain levels.

An alpha of 0 will produce gain1 = 1 and gain2 = 0. An alpha of 1.0 will produce the opposite, and alpha values in-between will be calculated based on a pair of overlapping convex sine curves.

References engine::AudioFadeCurve::alphaToGain(), gain1, and gain2.

Member Data Documentation

◆ gain1

float engine::AudioFadeCurve::CrossfadeLevels::gain1

Referenced by CrossfadeLevels().

◆ gain2

float engine::AudioFadeCurve::CrossfadeLevels::gain2

Referenced by CrossfadeLevels().


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