TracktionEngine
Classes | Public Member Functions | List of all members
tracktion::engine::ExpEnvelope Class Reference

Classes

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

Public Member Functions

 ExpEnvelope ()
 
void setParameters (const Parameters &newParameters)
 Sets the parameters that will be used by an ADSR object. More...
 
void setSampleRate (double d)
 
void reset ()
 Resets the envelope to an idle state. More...
 
void noteOn ()
 Starts the attack phase of the envelope. More...
 
void noteOff ()
 Starts the release phase of the envelope. More...
 
bool isActive () const
 Returns true if the envelope is in its attack, decay, sustain or release stage. More...
 
float getNextSample ()
 Returns the next sample value for an ADSR object. More...
 
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. More...
 
void setAnalog (bool a)
 

Constructor & Destructor Documentation

◆ ExpEnvelope()

tracktion::engine::ExpEnvelope::ExpEnvelope ( )

Member Function Documentation

◆ setParameters()

void tracktion::engine::ExpEnvelope::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

References tracktion::engine::ExpEnvelope::Parameters::attack, tracktion::engine::ExpEnvelope::Parameters::decay, tracktion::engine::ExpEnvelope::Parameters::release, and tracktion::engine::ExpEnvelope::Parameters::sustain.

◆ setSampleRate()

void tracktion::engine::ExpEnvelope::setSampleRate ( double  d)

◆ reset()

void tracktion::engine::ExpEnvelope::reset ( )

Resets the envelope to an idle state.

◆ noteOn()

void tracktion::engine::ExpEnvelope::noteOn ( )

Starts the attack phase of the envelope.

◆ noteOff()

void tracktion::engine::ExpEnvelope::noteOff ( )

Starts the release phase of the envelope.

◆ isActive()

bool tracktion::engine::ExpEnvelope::isActive ( ) const

Returns true if the envelope is in its attack, decay, sustain or release stage.

◆ getNextSample()

float tracktion::engine::ExpEnvelope::getNextSample ( )

Returns the next sample value for an ADSR object.

See also
applyEnvelopeToBuffer

Referenced by applyEnvelopeToBuffer().

◆ applyEnvelopeToBuffer()

template<typename FloatType >
void tracktion::engine::ExpEnvelope::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

References getNextSample().

◆ setAnalog()

void tracktion::engine::ExpEnvelope::setAnalog ( bool  a)

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