UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Phaser.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "DSP/Delay.h"
7#include "DSP/LFO.h"
8#include "DSP/Filter.h"
9
10namespace Audio
11{
12
13 class FPhaser
14 {
15 public:
18
19 SIGNALPROCESSING_API void Init(const float SampleRate, const int32 InNumChannels);
20
21 // Sets the phaser LFO rate
23
24 // Sets the wet level of the phaser
25 SIGNALPROCESSING_API void SetWetLevel(const float InWetLevel);
26
27 // Sets the feedback of the phaser
29
30 // Sets the phaser LFO type
32
33 // Sets whether or not to put the phaser in quadrature mode
35
36 // Process an audio frame
37 SIGNALPROCESSING_API void ProcessAudioFrame(const float* InFrame, float* OutFrame);
38
39 // Process an audio buffer.
40 SIGNALPROCESSING_API void ProcessAudio(const float* InBuffer, const int32 InNumSamples, float* OutBuffer);
41
42 protected:
43 SIGNALPROCESSING_API void ComputeNewCoefficients(const int32 ChannelIndex, const float LFOValue);
44
45 // First-order all-pass filters in series
46 static const int32 NumApfs = 6;
47 static const int32 MaxNumChannels = 2;
48
51 float Frequency;
52 float WetLevel;
53 float Feedback;
55
56 // 6 APFs per channel
59
60 // Feedback samples
62
64
65 // Number of channels actually used
67
69 };
70
71}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Init()
Definition LockFreeList.h:4
Definition Filter.h:33
Definition LFO.h:45
Definition Phaser.h:14
SIGNALPROCESSING_API FPhaser()
Definition Phaser.cpp:7
FLFO LFO
Definition Phaser.h:63
SIGNALPROCESSING_API void SetFrequency(const float InFreqHz)
Definition Phaser.cpp:72
SIGNALPROCESSING_API ~FPhaser()
Definition Phaser.cpp:19
ELFO::Type LFOType
Definition Phaser.h:54
SIGNALPROCESSING_API void ProcessAudioFrame(const float *InFrame, float *OutFrame)
Definition Phaser.cpp:128
bool bIsBiquadPhase
Definition Phaser.h:68
SIGNALPROCESSING_API void SetLFOType(const ELFO::Type LFOType)
Definition Phaser.cpp:98
static const int32 NumApfs
Definition Phaser.h:46
SIGNALPROCESSING_API void SetFeedback(const float InFeedback)
Definition Phaser.cpp:90
static const int32 MaxNumChannels
Definition Phaser.h:47
SIGNALPROCESSING_API void ComputeNewCoefficients(const int32 ChannelIndex, const float LFOValue)
Definition Phaser.cpp:113
int32 NumChannels
Definition Phaser.h:66
float FeedbackFrame[MaxNumChannels]
Definition Phaser.h:61
SIGNALPROCESSING_API void SetQuadPhase(const bool bQuadPhase)
Definition Phaser.cpp:108
FBiquadFilter APFs[MaxNumChannels][NumApfs]
Definition Phaser.h:57
int32 ControlRate
Definition Phaser.h:50
float Frequency
Definition Phaser.h:51
SIGNALPROCESSING_API void SetWetLevel(const float InWetLevel)
Definition Phaser.cpp:82
float WetLevel
Definition Phaser.h:52
int32 ControlSampleCount
Definition Phaser.h:49
float Feedback
Definition Phaser.h:53
SIGNALPROCESSING_API void ProcessAudio(const float *InBuffer, const int32 InNumSamples, float *OutBuffer)
Definition Phaser.cpp:171
FVector2D APFFrequencyRanges[NumApfs]
Definition Phaser.h:58
Type
Definition LFO.h:13
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53