IOscBase

Oscillator base class.

Windows
MacOS
Linux

Inheritance Hierarchy

IOscBase

FLFO

FOsc

References

Module

SignalProcessing

Header

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

Include

#include "DSP/Osc.h"

Syntax

class IOscBase

Remarks

Oscillator base class.

Variables

Name Description

Protected variable

float

 

BaseFreq

The base frequency of the oscillator.

Protected variable

bool

 

bChanged

Protected variable

bool

 

bIsPlaying

Whether or not the oscillator is on or off.

Protected variable

bool

 

bIsSync

Protected variable

float

 

ExternalGainMod

Linear gain modulation of the oscillator (used in amplitude modulation)

Protected variable

float

 

Freq

The final frequency of the oscillator after computing all factors contributing to frequency.

Protected variable

FOscFrequencyMo...

 

FreqData

Holds all frequency data.

Protected variable

float

 

Gain

Linear gain of the oscillator.

Protected variable

FPatchDestinati...

 

ModAddDest

Protected variable

FPatchDestinati...

 

ModFrequencyDest

Protected variable

FPatchDestinati...

 

ModGainDest

Protected variable

FModulationMatr...

 

ModMatrix

Modulation matrix to use for this oscillator.

Protected variable

FPatchDestinati...

 

ModPulseWidthDest

Protected variable

FPatchDestinati...

 

ModScaleDest

Protected variable

float

 

Nyquist

Maximum frequency allowed.

Protected variable

float

 

Phase

The current phase of oscillator (between 0.0 and 1.0)

Protected variable

float

 

PhaseInc

How much to increment the phase each update.

Protected variable

float

 

PulseWidth

The final pulse width.

Protected variable

float

 

PulseWidthBase

Pulse width used in square LFOs.

Protected variable

float

 

PulseWidthMod

Pulse width modulator factor.

Protected variable

float

 

SampleRate

Sample rate of the oscillator.

Protected variable

IOscBase *

 

SlaveOsc

Ptr to a slave oscillator that can be triggered to 0 phase if it is synced.

Protected variable

int32

 

VoiceId

The voice ID that this oscillator belongs to.

Constructors

Name Description

Public function

IOscBase()

Destructors

Name Description

Public function Virtual

~IOscBase()

Functions

Name Description

Public function

float

 

Generate

(
    float* AuxOutput
)

Generates the next sample of audio, optionally passes out the auxillary output (supported in some oscillators)

Public function Const

float

 

GetFrequency()

Returns the frequency of the oscillator.

Public function Const

float

 

GetGain()

Returns the frequency of the oscillator.

Public function Const

FPatchDestin...

 

GetModDestAdd()

Public function Const

FPatchDestin...

 

GetModDestFrequency()

Return patch destinations for various modulatable parameters.

Public function Const

FPatchDestin...

 

GetModDestGain()

Public function Const

FPatchDestin...

 

GetModDestPulseWidth()

Public function Const

FPatchDestin...

 

GetModDestScale()

Protected function Const

float

 

GetPhase()

Returns the current phase of the oscillator.

Protected function Const

float

 

GetQuadPhase()

Returns the quadrature phase, wrapped.

Public function Virtual

void

 

Init

(
    const float InSampleRate,
    const int32 InVoiceId,
    FModulationMatrix* InMatrix,
    const int32 ModMatrixStage
)

Initializes the oscillator.

Public function Const

bool

 

IsPlaying()

Returns whether or not this oscillator is playing.

Public function Const

bool

 

IsSync()

Returns if this oscillator should be synced to a master oscillator.

Public function Virtual

void

 

Reset()

Resets the oscillator.

Public function

void

 

ResetPhase()

Resets the phase of this oscillator to 0.0.

Public function

void

 

SetCents

(
    const float InCents
)

Public function

void

 

SetDetune

(
    const float InDetune
)

Public function

void

 

SetFreqScale

(
    const float InFreqScale
)

Public function

void

 

SetFrequency

(
    const float InFreqBase
)

Sets the base frequency of the oscillator.

Public function

void

 

SetFrequencyMod

(
    const float InFreqMod
)

Sets a frequency modulation value.

Public function

void

 

SetGain

(
    const float InGain
)

Sets the gain of the oscillator.

Public function

void

 

SetGainMod

(
    const float InGainMod
)

Sets the gain modulator of the oscillator.

Public function

void

 

SetNote

(
    const float InNote
)

Sets the base frequency of the oscillator from the midi.

Public function

void

 

SetOctave

(
    const float InOctave
)

Public function

void

 

SetPitchBend

(
    const float InPitchBend
)

Public function

void

 

SetPulseWidth

(
    const float InPulseWidth
)

Sets the LFO pulse width for square-wave type oscillators.

Public function

void

 

SetSampleRate

(
    const float InSampleRate
)

Public function

void

 

SetSemitones

(
    const float InSemiTone
)

Public function

void

 

SetSlaveOsc

(
    IOscBase* InSlaveOsc
)

Sets the input oscillator as the slave of this oscillator.

Public function

void

 

SetSync

(
    const bool bInSync
)

Sets whether or not this oscillator should be synced to a master oscillator. Master oscillator needs to have set this oscillator as its slave.

Public function

void

 

Start()

Starts the oscillator.

Public function

void

 

Stop()

Stops the oscillator.

Public function Virtual

void

 

Update()

Updates oscillator state.

Protected function

void

 

UpdatePhase()

Updates the phase based on the phase increment.

Protected function

bool

 

WrapPhase()

Returns true if there was a phase wrap this update.

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