Navigation
API > API/Runtime > API/Runtime/SignalProcessing > API/Runtime/SignalProcessing/DSP
References
| Module | SignalProcessing |
| Header | /Engine/Source/Runtime/SignalProcessing/Public/DSP/Granulator.h |
| Include | #include "DSP/Granulator.h" |
Syntax
class FGranularSynth
Remarks
A stereo granulator.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< int32 > | ActiveGrains | ||
| FAmp | Amp | ||
| bool | bScrubMode | ||
| float | CurrentPlayHeadFrame | The current playhead frame. | |
| int32 | CurrentSpawnFrameCount | The current number of frames since last attempt to spawn. | |
| TArray< int32 > | DeadGrains | ||
| FGrainParam | Duration | ||
| FDynamicsProcessor | DynamicsProcessor | ||
| TArray< int32 > | FreeGrains | ||
| FGrainParam | Frequency | ||
| FEnvelope | GainEnv | Overall envelope of the granulator. | |
| FGrainEnvelope | GrainEnvelope | The single envelope function used by all grains. | |
| EGrainEnvelopeType | GrainEnvelopeType | Current grain envelope type. | |
| EOsc::Type | GrainOscType | The oscillator type to use if in synthesis mode. | |
| TArray< FGrain > | GrainPool | A pool of free grains. Will dynamically grow to needed grains based on grain density. | |
| float | GrainProbability | The probability of a grain occurring when it tries to spawn (based off the GrainsPerSecond) | |
| float | GrainsPerSecond | The rate at which grains are spawned. | |
| EGranularSynthMode | Mode | What mode the granular synthesizer is in. | |
| int32 | NextSpawnFrame | The next frame when a grain needs to spawn. | |
| int32 | NoteDurationFrameCount | Counts for overall note duration of the granulator. | |
| int32 | NoteDurationFrameEnd | ||
| int32 | NumActiveGrains | ||
| int32 | NumChannels | ||
| FGrainParam | Pan | ||
| FGrainParam | Pitch | ||
| float | PlaybackSpeed | ||
| TSampleBuffer< int16 > | SampleBuffer | The buffer which holds the sample to be granulated. | |
| int32 | SampleRate | ||
| FLinearEase | SeekingPlayheadTimeFrame | ||
| FGrainParam | Volume |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Generate
(
float* OutAudiobuffer, |
Generate the next audio buffer. | |
| float | Get current playback time (in granular mode) | ||
| int32 | Return the number of currently active grains. | ||
| float | Returns the duration of the internal loaded sample buffer. | ||
| float | GetWrappedPlayheadPosition
(
float PlayheadFrame |
Return wrapped playhead position. | |
| void | Init
(
const int32 InSampleRate, |
||
| void | LoadSampleBuffer
(
const TSampleBuffer< int16 >& InSampleBuffer |
Loads a sound wave to use for granular synth mode. | |
| void | NoteOff
(
const uint32 InMidiNote, |
Note off, triggers release envelope. | |
| void | NoteOn
(
const uint32 InMidiNote, |
Plays a granular synthesis "Note". | |
| void | SeekTime
(
const float InTimeSec, |
Seeks the loaded buffer used for granulation. Grains will spawn from this location. | |
| void | SetAttackTime
(
const float InAttackTimeMSec |
Sets the granular synth attack time. | |
| void | SetDecayTime
(
const float InDecayTimeMSec |
Sets the granular synth decay time. | |
| void | SetGrainDuration
(
const float InBaseDuration, |
Sets the grain duration. | |
| void | SetGrainDurationScale
(
const float InDurationScale |
Sets the grain duration modulation. | |
| void | SetGrainEnvelopeType
(
const EGrainEnvelopeType InGrainEnvelopeType |
Sets the envelope type to use for new grains. Will instantly switch all grains to this envelope type so may cause discontinuities if switched while playing. | |
| void | SetGrainFrequency
(
const float InFrequency, |
Sets the grain frequency. | |
| void | SetGrainFrequencyModulation
(
const float InFrequencyModulation |
Sets the grain frequency modulation. | |
| void | SetGrainOscType
(
const EOsc::Type InGrainOscType |
Sets the grain oscillator type (for use with granular synthesis mode) | |
| void | SetGrainPan
(
const float InBasePan, |
Sets the grain azimuth (pan) and randomization range. | |
| void | SetGrainPanModulation
(
const float InPanModulation |
Sets the grain azimuth modulation - allows modulating actively playing grain azimuths. | |
| void | SetGrainPitch
(
const float InBasePitch, |
Sets the base grain pitch and randomization range. | |
| void | SetGrainPitchModulation
(
const float InPitchModulation |
Sets the grain pitch modulation allows modulating actively playing grain pitches. | |
| void | SetGrainProbability
(
const float InGrainProbability |
The probability at which a grain will occur when a grain tries to spawn. Allows for sporatic grain generation. | |
| void | SetGrainsPerSecond
(
const float InNumberOfGrainsPerSecond |
The rate at which new grains are attempted to be spawned. | |
| void | SetGrainVolume
(
const float InBaseVolume, |
Sets the base grain volume and randomization range. | |
| void | SetGrainVolumeModulation
(
const float InVolumeModulation |
Sets the grain modulation allows modulating actively playing grain volumes. | |
| void | SetPlaybackSpeed
(
const float InPlaybackSpeed |
Sets how fast the granular play head for granulation is is played (and in what direction) | |
| void | SetReleaseTime
(
const float InReleaseTimeMSec |
Sets the granular synth releas etime. | |
| void | SetScrubMode
(
const bool bIsScrubMode |
Sets whether or not the buffer playback advances on its own or if it just sits in one place. | |
| void | SetSustainGain
(
const float InSustainGain |
Sets the granular synth sustain gain. | |
| void | SpawnGrain () |
Spawns grains. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FGrainParam | Current grain azimuth modulation. |