You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Audio bus is a new asset type that allows audio to be routed around to effects, etc. - Extracts the underlying logic from source buses and changes source bus semantics to be a sonification of audio buses. Audio buses do not render to be audible on their own. - Main use-case is side-chaining audio effects (e.g. side chain compression, auto-wah filters, etc). #rb Ethan.Geller, Rob.Gay, Maxwell.Hayes, Phil.Popp, Ryan.Mangin #jira UE-88494 #ROBOMERGE-SOURCE: CL 11449969 via CL 11450113 #ROBOMERGE-BOT: (v654-11333218) [CL 11450145 by aaron mcleran in Main branch]
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "DSP/Osc.h"
|
|
#include "DSP/MultithreadedPatching.h"
|
|
|
|
namespace Audio
|
|
{
|
|
// Ring modulation effect
|
|
// https://en.wikipedia.org/wiki/Ring_modulation
|
|
class SIGNALPROCESSING_API FRingModulation
|
|
{
|
|
public:
|
|
// Constructor
|
|
FRingModulation();
|
|
|
|
// Destructor
|
|
~FRingModulation();
|
|
|
|
// Initialize the equalizer
|
|
void Init(const float InSampleRate, const int32 InNumChannels);
|
|
|
|
// The type of modulation
|
|
void SetModulatorWaveType(const EOsc::Type InType);
|
|
|
|
// Set the ring modulation frequency
|
|
void SetModulationFrequency(const float InModulationFrequency);
|
|
|
|
// Set the ring modulation depth
|
|
void SetModulationDepth(const float InModulationDepth);
|
|
|
|
// Sets that the modulation buffer is external
|
|
void SetExternalPatchSource(Audio::FPatchOutputStrongPtr InPatch);
|
|
|
|
// Set the dry level of the ring modulation
|
|
void SetDryLevel(const float InDryLevel) { DryLevel = InDryLevel; }
|
|
|
|
// Set the wet level of the ring modulation
|
|
void SetWetLevel(const float InWetLevel);
|
|
|
|
// Process audio buffer
|
|
void ProcessAudio(const float* InBuffer, const int32 InNumSamples, float* OutBuffer);
|
|
|
|
private:
|
|
void UpdateScale();
|
|
|
|
Audio::FPatchOutputStrongPtr Patch;
|
|
Audio::FOsc Osc;
|
|
float ModulationFrequency;
|
|
float ModulationDepth;
|
|
float DryLevel;
|
|
float WetLevel;
|
|
float Scale;
|
|
int32 NumChannels;
|
|
TArray<float> ModulationBuffer;
|
|
};
|
|
|
|
}
|