tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | List of all members
tracktion::engine::AudioFadeCurve Struct Reference

Classes

struct  Concave
 A concave sine-shaped curve. More...
 
struct  Convex
 A convex sine-shaped curve. More...
 
struct  CrossfadeLevels
 Calculates the two gain multipliers to use for mixing between two sources, given a position alpha from 0 to 1.0. More...
 
struct  Linear
 A linear fade curve. More...
 
struct  SCurve
 An S-shaped curve. More...
 

Public Types

enum  Type { linear , convex , concave , sCurve }
 A enumeration of the curve classes available. More...
 

Static Public Member Functions

template<typename CurveClass >
static float alphaToGain (float alpha) noexcept
 Converts an alpha position along the curve (0 to 1.0) into the gain at that point.
 
static float alphaToGainForType (Type type, float alpha) noexcept
 Converts an alpha position along the curve (0 to 1.0) into the gain at that point.
 
template<typename CurveClass , typename DestSamplePointer >
static void renderBlock (DestSamplePointer &dest, int numSamples, float startAlpha, float endAlpha) noexcept
 Multiplies a block of samples by the curve shape between two alpha-positions.
 
template<typename DestSamplePointer >
static void renderBlockForType (DestSamplePointer &dest, int numSamples, float startAlpha, float endAlpha, Type type) noexcept
 Multiplies a block of samples by the curve shape between two alpha-positions.
 
static void applyCrossfadeSection (juce::AudioBuffer< float > &, int channel, int startSample, int numSamples, Type type, float startAlpha, float endAlpha)
 
static void applyCrossfadeSection (juce::AudioBuffer< float > &, int startSample, int numSamples, Type type, float startAlpha, float endAlpha)
 
static void addWithCrossfade (juce::AudioBuffer< float > &dest, const juce::AudioBuffer< float > &src, int destChannel, int destStartIndex, int sourceChannel, int sourceStartIndex, int numSamples, Type type, float startAlpha, float endAlpha)
 
static void drawFadeCurve (juce::Graphics &, const AudioFadeCurve::Type, float x1, float x2, float top, float bottom, juce::Rectangle< int > clip)
 

Detailed Description

Definition at line 14 of file tracktion_AudioFadeCurve.h.

Member Enumeration Documentation

◆ Type

A enumeration of the curve classes available.

Definition at line 46 of file tracktion_AudioFadeCurve.h.

Member Function Documentation

◆ addWithCrossfade()

void tracktion::engine::AudioFadeCurve::addWithCrossfade ( juce::AudioBuffer< float > &  dest,
const juce::AudioBuffer< float > &  src,
int  destChannel,
int  destStartIndex,
int  sourceChannel,
int  sourceStartIndex,
int  numSamples,
const AudioFadeCurve::Type  type,
float  startAlpha,
float  endAlpha 
)
static

Definition at line 402 of file tracktion_AudioUtilities.cpp.

◆ alphaToGain()

template<typename CurveClass >
static float tracktion::engine::AudioFadeCurve::alphaToGain ( float  alpha)
staticnoexcept

Converts an alpha position along the curve (0 to 1.0) into the gain at that point.

Definition at line 56 of file tracktion_AudioFadeCurve.h.

◆ alphaToGainForType()

static float tracktion::engine::AudioFadeCurve::alphaToGainForType ( Type  type,
float  alpha 
)
staticnoexcept

Converts an alpha position along the curve (0 to 1.0) into the gain at that point.

Definition at line 63 of file tracktion_AudioFadeCurve.h.

◆ applyCrossfadeSection() [1/2]

void tracktion::engine::AudioFadeCurve::applyCrossfadeSection ( juce::AudioBuffer< float > &  buffer,
int  channel,
int  startSample,
int  numSamples,
AudioFadeCurve::Type  type,
float  startAlpha,
float  endAlpha 
)
static

Definition at line 355 of file tracktion_AudioUtilities.cpp.

◆ applyCrossfadeSection() [2/2]

void tracktion::engine::AudioFadeCurve::applyCrossfadeSection ( juce::AudioBuffer< float > &  buffer,
int  startSample,
int  numSamples,
AudioFadeCurve::Type  type,
float  startAlpha,
float  endAlpha 
)
static

Definition at line 368 of file tracktion_AudioUtilities.cpp.

◆ drawFadeCurve()

void tracktion::engine::AudioFadeCurve::drawFadeCurve ( juce::Graphics g,
const AudioFadeCurve::Type  fadeType,
float  x1,
float  x2,
float  top,
float  bottom,
juce::Rectangle< int clip 
)
static

Definition at line 427 of file tracktion_AudioUtilities.cpp.

◆ renderBlock()

template<typename CurveClass , typename DestSamplePointer >
static void tracktion::engine::AudioFadeCurve::renderBlock ( DestSamplePointer &  dest,
int  numSamples,
float  startAlpha,
float  endAlpha 
)
staticnoexcept

Multiplies a block of samples by the curve shape between two alpha-positions.

The DestSamplePointer object must be a class that implements an apply() method that gets called with each gain level.

Definition at line 78 of file tracktion_AudioFadeCurve.h.

◆ renderBlockForType()

template<typename DestSamplePointer >
static void tracktion::engine::AudioFadeCurve::renderBlockForType ( DestSamplePointer &  dest,
int  numSamples,
float  startAlpha,
float  endAlpha,
Type  type 
)
staticnoexcept

Multiplies a block of samples by the curve shape between two alpha-positions.

The DestSamplePointer object must be a class that implements an apply() method that gets called with each gain level.

Definition at line 100 of file tracktion_AudioFadeCurve.h.


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