UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
WaveTableOsc.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
7namespace Audio
8{
9 // Wavetable oscillator types
25
26 class FWaveTableOsc;
27
28
29 // A wave table oscillator class
31 {
32 public:
33 // Constructor
35
36 // Virtual Destructor
38
39 // Initialize the wave table oscillator
40 SIGNALPROCESSING_API void Init(const float InSampleRate, const float InFrequencyHz);
41
42 // Sets the sample rate of the oscillator.
44
45 // Resets the wave table read indices.
47
48 // Sets the amount to scale and add to the output of the wave table
49 SIGNALPROCESSING_API void SetScaleAdd(const float InScale, const float InAdd);
50
51 // Returns the type of the wave table oscillator.
53
54 // Sets the frequency of the wave table oscillator.
56
57 // Returns the frequency of the wave table oscillator.
58 float GetFrequencyHz() const { return FrequencyHz; }
59
60 // Returns the internal table used in the wave table.
63
64 // Processes the wave table, outputs the normal and quad phase (optional) values
66
67 // Creates a wave table using internal factories for standard wave tables or uses custom wave table factor if it exists.
69
70 protected:
72
73 // The wave table buffer
75
76 // The frequency of the output (given the sample rate)
78
79 // The sample rate of the oscillator
81
82 // Normal phase read index
84
85 // The quad-phase read index
87
88 // The phase increment (based on frequency)
90
91 // Amount to scale the output by
93
94 // Amount to add to the output
95 float OutputAdd;
96
97 // The wave table oscillator type
99 };
100
101}
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 WaveTableOsc.h:31
EWaveTable::Type WaveTableType
Definition WaveTableOsc.h:98
float QuadPhaseReadIndex
Definition WaveTableOsc.h:86
SIGNALPROCESSING_API FWaveTableOsc()
Definition WaveTableOsc.cpp:7
virtual SIGNALPROCESSING_API ~FWaveTableOsc()
Definition WaveTableOsc.cpp:20
EWaveTable::Type GetType() const
Definition WaveTableOsc.h:52
float NormalPhaseReadIndex
Definition WaveTableOsc.h:83
SIGNALPROCESSING_API void SetScaleAdd(const float InScale, const float InAdd)
Definition WaveTableOsc.cpp:39
SIGNALPROCESSING_API void UpdateFrequency()
Definition WaveTableOsc.cpp:61
static SIGNALPROCESSING_API TSharedPtr< FWaveTableOsc > CreateWaveTable(const EWaveTable::Type WaveTableType, const int32 WaveTableSize=1024)
Definition WaveTableOsc.cpp:111
SIGNALPROCESSING_API void SetSampleRate(const float InSampleRate)
Definition WaveTableOsc.cpp:33
float FrequencyHz
Definition WaveTableOsc.h:77
SIGNALPROCESSING_API void Generate(float *OutputNormalPhase, float *OutputQuadPhase=nullptr)
Definition WaveTableOsc.cpp:76
SIGNALPROCESSING_API void SetFrequencyHz(const float InFrequencyHz)
Definition WaveTableOsc.cpp:55
float PhaseIncrement
Definition WaveTableOsc.h:89
float OutputAdd
Definition WaveTableOsc.h:95
SIGNALPROCESSING_API TArray< float > & GetTable()
Definition WaveTableOsc.cpp:66
float GetFrequencyHz() const
Definition WaveTableOsc.h:58
TArray< float > WaveTableBuffer
Definition WaveTableOsc.h:74
SIGNALPROCESSING_API void Reset()
Definition WaveTableOsc.cpp:45
float OutputScale
Definition WaveTableOsc.h:92
float SampleRate
Definition WaveTableOsc.h:80
Definition Array.h:670
Definition SharedPointer.h:692
Type
Definition WaveTableOsc.h:13
@ SawWaveTable
Definition WaveTableOsc.h:16
@ SineWaveTable
Definition WaveTableOsc.h:15
@ Custom
Definition WaveTableOsc.h:22
@ None
Definition WaveTableOsc.h:14
@ BandLimitedTriangleWaveTable
Definition WaveTableOsc.h:20
@ SquareWaveTable
Definition WaveTableOsc.h:18
@ BandLimitedSawWaveTable
Definition WaveTableOsc.h:19
@ BandLimitedSquareWaveTable
Definition WaveTableOsc.h:21
@ TriangleWaveTable
Definition WaveTableOsc.h:17
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53