TracktionEngine
Public Member Functions | Public Attributes | List of all members
tracktion::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...

Public Member Functions

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

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()

tracktion::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.

Member Data Documentation

◆ gain1

float tracktion::engine::AudioFadeCurve::CrossfadeLevels::gain1

◆ gain2

float tracktion::engine::AudioFadeCurve::CrossfadeLevels::gain2

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