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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tracktion::engine::LinEnvelope Class Reference

Classes

struct  Parameters
 Holds the parameters being used by an ADSR object. More...
 

Public Types

enum class  State {
  idle , attack , decay , sustain ,
  release
}
 

Public Member Functions

void setParameters (const Parameters &newParameters)
 Sets the parameters that will be used by an ADSR object.
 
void setSampleRate (double sr)
 
float getEnvelopeValue ()
 
State getState ()
 
void noteOn ()
 
void noteOff ()
 
void reset ()
 
float getNextSample ()
 Returns the next sample value for an ADSR object.
 
template<typename FloatType >
void applyEnvelopeToBuffer (juce::AudioBuffer< FloatType > &buffer, int startSample, int numSamples)
 This method will conveniently apply the next numSamples number of envelope values to an AudioBuffer.
 

Protected Member Functions

void calculateRates (const Parameters &parameters)
 

Protected Attributes

State currentState
 
Parameters currentParameters
 
double sampleRate
 
float envelopeVal
 
float sustainLevel
 
float attackRate
 
float decayRate
 
float releaseRate
 

Detailed Description

Definition at line 241 of file tracktion_Envelope.h.


Class Documentation

◆ tracktion::engine::LinEnvelope::Parameters

struct tracktion::engine::LinEnvelope::Parameters

Holds the parameters being used by an ADSR object.

Definition at line 248 of file tracktion_Envelope.h.

Class Members
float attack Attack time in seconds.
float decay Decay time in seconds.
float release Release time in seconds.
float sustain Sustain level.

Member Enumeration Documentation

◆ State

enum class tracktion::engine::LinEnvelope::State
strong

Definition at line 244 of file tracktion_Envelope.h.

Member Function Documentation

◆ applyEnvelopeToBuffer()

template<typename FloatType >
void tracktion::engine::LinEnvelope::applyEnvelopeToBuffer ( juce::AudioBuffer< FloatType > &  buffer,
int  startSample,
int  numSamples 
)

This method will conveniently apply the next numSamples number of envelope values to an AudioBuffer.

See also
getNextSample

Definition at line 389 of file tracktion_Envelope.h.

◆ calculateRates()

void tracktion::engine::LinEnvelope::calculateRates ( const Parameters parameters)
protected

Definition at line 407 of file tracktion_Envelope.h.

◆ getEnvelopeValue()

float tracktion::engine::LinEnvelope::getEnvelopeValue ( )

Definition at line 278 of file tracktion_Envelope.h.

◆ getNextSample()

float tracktion::engine::LinEnvelope::getNextSample ( )

Returns the next sample value for an ADSR object.

See also
applyEnvelopeToBuffer

Definition at line 331 of file tracktion_Envelope.h.

◆ getState()

State tracktion::engine::LinEnvelope::getState ( )

Definition at line 279 of file tracktion_Envelope.h.

◆ noteOff()

void tracktion::engine::LinEnvelope::noteOff ( )

Definition at line 308 of file tracktion_Envelope.h.

◆ noteOn()

void tracktion::engine::LinEnvelope::noteOn ( )

Definition at line 281 of file tracktion_Envelope.h.

◆ reset()

void tracktion::engine::LinEnvelope::reset ( )

Definition at line 321 of file tracktion_Envelope.h.

◆ setParameters()

void tracktion::engine::LinEnvelope::setParameters ( const Parameters newParameters)

Sets the parameters that will be used by an ADSR object.

You must have called setSampleRate() with the correct sample rate before this otherwise the values may be incorrect!

See also
getParameters

Definition at line 268 of file tracktion_Envelope.h.

◆ setSampleRate()

void tracktion::engine::LinEnvelope::setSampleRate ( double  sr)

Definition at line 276 of file tracktion_Envelope.h.

Member Data Documentation

◆ attackRate

float tracktion::engine::LinEnvelope::attackRate
protected

Definition at line 423 of file tracktion_Envelope.h.

◆ currentParameters

Parameters tracktion::engine::LinEnvelope::currentParameters
protected

Definition at line 418 of file tracktion_Envelope.h.

◆ currentState

State tracktion::engine::LinEnvelope::currentState
protected

Definition at line 417 of file tracktion_Envelope.h.

◆ decayRate

float tracktion::engine::LinEnvelope::decayRate
protected

Definition at line 423 of file tracktion_Envelope.h.

◆ envelopeVal

float tracktion::engine::LinEnvelope::envelopeVal
protected

Definition at line 420 of file tracktion_Envelope.h.

◆ releaseRate

float tracktion::engine::LinEnvelope::releaseRate
protected

Definition at line 423 of file tracktion_Envelope.h.

◆ sampleRate

double tracktion::engine::LinEnvelope::sampleRate
protected

Definition at line 419 of file tracktion_Envelope.h.

◆ sustainLevel

float tracktion::engine::LinEnvelope::sustainLevel
protected

Definition at line 422 of file tracktion_Envelope.h.


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