FEnvelope

Envelope class generates ADSR style envelope.

Windows
MacOS
Linux

References

Module

SignalProcessing

Header

/Engine/Source/Runtime/SignalProcessing/Public/DSP/Envelope.h

Include

#include "DSP/Envelope.h"

Syntax

class FEnvelope

Remarks

Envelope class generates ADSR style envelope.

Variables

Name Description

Protected variable

FEnvData

 

AttackData

Protected variable

float

 

AttackTimeMSec

Protected variable

uint8: 1

 

bBiasInvert

Bias output inversions.

Protected variable

uint8: 1

 

bChanged

Whether or not this envelope has changed and needs to have values recomputed.

Protected variable

uint8: 1

 

bCurrentCycleIsADOnly

Tracks if the current envelope was started with sustain at 0.0 (avoids bug where sustain being turned up during decay phase makes

hang)

Protected variable

float

 

BiasDepth

Protected variable

FPatchSource

 

BiasedEnvSource

Protected variable

uint8: 1

 

bInvert

Inverts the output.

Protected variable

uint8: 1

 

bIsLegatoMode

Whether or not the envelope is reset back to attack when started.

Protected variable

uint8: 1

 

bIsRetriggerMode

Whether or not the envelope value is set to zero when finished.

Protected variable

uint8: 1

 

bIsSimulatingAnalog

Whether or not we want to simulate analog behavior.

Protected variable

float

 

CurrentEnvelopeBiasValue

Protected variable

float

 

CurrentEnvelopeValue

Protected variable

EEnvelopeState

 

CurrentState

Protected variable

FEnvData

 

DecayData

Protected variable

float

 

DecayTimeMsec

Protected variable

float

 

Depth

Protected variable

FPatchSource

 

EnvSource

Protected variable

FModulationMatr...

 

ModMatrix

Mod matrix.

Protected variable

float

 

OutputGain

Protected variable

FEnvData

 

ReleaseData

Protected variable

float

 

ReleaseTimeMsec

Protected variable

float

 

SampleRate

Protected variable

float

 

ShutdownDelta

Protected variable

float

 

ShutdownTimeMsec

Protected variable

float

 

SustainGain

Protected variable

int32

 

VoiceId

The current envelope value, used to compute exponential envelope curves.

Constructors

Name Description

Public function

FEnvelope()

Destructors

Name Description

Public function Virtual

~FEnvelope()

Functions

Name Description

Public function Virtual

float

 

Generate

(
    float* BiasedOutput
)

Generate the next output value of the envelope.

Public function Const

const FPatch...

 

GetModSourceBiasEnv()

Public function Const

const FPatch...

 

GetModSourceEnv()

Get the envelope's patch nodes.

Public function

void

 

Init

(
    const float InSampleRate,
    const int32 InVoiceId,
    FModulationMatrix* InModMatrix,
    const bool bInSimulateAnalog
)

Initialize the envelope with the given sample rate.

Public function Virtual Const

bool

 

IsDone()

Queries if the envelope has finished.

Public function Const

bool

 

IsRetrigger()

Public function Virtual

void

 

Kill()

Kills the envelope (will cause discontinuity)

Public function Virtual

void

 

Reset()

Resets the envelope.

Public function Virtual

void

 

SetAttackTime

(
    const float InAttackTimeMsec
)

Sets the envelope attack time in msec.

Public function Virtual

void

 

SetBiasDepth

(
    const float InDepth
)

Sets the depth of the bias output.

Public function Virtual

void

 

SetBiasInvert

(
    const bool bInBiasInvert
)

Inverts the value of the biased envelope output.

Public function Virtual

void

 

SetDecayTime

(
    const float InDecayTimeMsec
)

Sets the envelope decay time in msec.

Public function Virtual

void

 

SetDepth

(
    const float InDepth
)

Sets the envelope depth.

Public function Virtual

void

 

SetInvert

(
    const bool bInInvert
)

Inverts the value of envelope output.

Public function

void

 

SetLegato

(
    const bool bInLegatoMode
)

Sets whether the envelope is in legato mode. Legato mode doesn't restart the envelope if it's already playing.

Public function Virtual

void

 

SetReleaseTime

(
    const float InReleaseTimeMsec
)

Sets the envelope release time in msec.

Public function

void

 

SetRetrigger

(
    const bool bInRetrigger
)

Sets whether or not the envelope is zero'd when reset.

Public function

void

 

SetSimulateAnalog

(
    const bool bInSimulatingAnalog
)

Sets the envelope mode.

Public function Virtual

void

 

SetSustainGain

(
    const float InSustainGain
)

Sets the envelope sustain gain in linear gain values.

Public function Virtual

void

 

Shutdown()

Puts envelope into shutdown mode, which is a much faster cutoff than release, but avoids pops.

Public function Virtual

void

 

Start()

Start the envelope, puts envelope in attack state.

Public function Virtual

void

 

StartLegato()

Public function Virtual

void

 

StartLegato

(
    const float InNewDepth
)

For truly legato envelope logic, we need to know the new sustain gain (if its being changed).

Public function Virtual

void

 

Stop()

Stop the envelope, puts in the release state. Can optionally force to off state.

Public function Virtual

void

 

Update()

Update the state of the envelope.

Classes

Name

Description

Protected struct

FEnvData

Enums

Name

Description

Protected enum

EEnvelopeState

States for the envelope state machine.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss