FGrain

Class representing a grain of audio.

Windows
MacOS
Linux

References

Module

SignalProcessing

Header

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

Include

#include "DSP/Granulator.h"

Syntax

class FGrain

Remarks

Class representing a grain of audio.

Variables

Name Description

Protected variable

float

 

CurrentFrameCount

The current frame count the grain is on.

Protected variable

float

 

CurrentFrequency

Current frequency.

Protected variable

float

 

CurrentPan

The current pan.

Protected variable

float

 

CurrentPitch

The current pitch.

Protected variable

float

 

CurrentVolumeScale

The current volume scale.

Protected variable

float

 

DurationScale

How quickly we read through the envelope.

Protected variable

float

 

EndFrameCount

The end frame count the grain will finish on.

Protected variable

TArray< float >

 

FrameScratch

Scratch buffer for sample reading.

Protected variable

FGrainData

 

GrainData

Grain data struct.

Protected variable

int32

 

GrainId

Grain id.

Protected variable

FOsc

 

Osc

Oscillator to use for synthesis mode.

Protected variable

FGranularSynth ...

 

Parent

Parent synth.

Protected variable

FSampleBufferRe...

 

SampleBufferReader

The sample buffer reader to use for the grain of the mode is granulation.

Protected variable

TArray< float >

 

SpeakerMap

Speaker map based on the current grain azimuth.

Constructors

Name Description

Public function

FGrain

(
    const int32 InGrainId,
    FGranularSynth* InParent
)

Destructors

Name Description

Public function

~FGrain()

Functions

Name Description

Public function

bool

 

GenerateFrame

(
    float* OutStereoFrame
)

Generates the next frame from the grain.

Protected function

float

 

GetEnvelopeValue()

Public function Const

bool

 

IsDone()

Queries if this grain is finished playing and needs to be reaped.

Public function

void

 

Play

(
    const FGrainData& InGrainData
)

Plays the grain with the supplied grain data.

Public function

void

 

SetDurationScale

(
    const float InDurationScale
)

Changes how quickly the grain reads through envelope.

Public function

void

 

SetOscFrequency

(
    const float InFrequency
)

Sets the oscillator frequency.

Public function

void

 

SetOscFrequencyModuation

(
    const float InFrequencyModulation
)

Sets the oscillator frequency modulation.

Public function

void

 

SetOscType

(
    const EOsc::Type InType
)

Changes the oscillator type for the grain (if the grain is in synth mode)

Public function

void

 

SetPanModulation

(
    const float InPanModulation
)

Sets the pan modulation angle.

Public function

void

 

SetPitchModulation

(
    const float InPitchModulation
)

Sets the grain pitch modulation.

Public function

void

 

SetVolumeModulation

(
    const float InVolumeModulation
)

Sets the grain modulation.

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