VJ Master 1.0
Real-time audio analysis and visualisation.
Loading...
Searching...
No Matches
AST_C_VisAudioReactiveBoids Class Reference

An audio-reactive boids simulation actor that uses a managed compute shader to simulate boid behavior based on audio input. More...

#include <ST_C_VisAudioReactiveBoids.h>

Public Member Functions

 AST_C_VisAudioReactiveBoids ()
Public Member Functions inherited from AST_VisComputeBase
 AST_VisComputeBase ()
virtual void Tick (float DeltaTime) override
Public Member Functions inherited from AST_VisBase
 AST_VisBase ()
virtual void HandleBeginPlay ()
virtual void EndPlay (const EEndPlayReason::Type EndPlayReason) override
virtual bool RegisterToIO (EAudioIOType NewAudioIOType)
bool RegisterToIO (int32 NewAudioIOType)
virtual void DeregisterFromIO (EAudioIOType CurrAudioIOType)
void DeregisterFromIO (int32 CurrAudioIOType)
Public Member Functions inherited from IST_AudioProcessingInterface
void OnAudioIOStatusChanged (bool bIsActive, FIntPoint IOId)
 Event triggered when the status of an audio I/O device changes.
void OnRawMagnitudesReady (const TArray< float > &RawMagnitudes, FIntPoint IOId)
 Event triggered when raw magnitude data is ready for an audio I/O device.
void OnFrequencyBandsReady (const TArray< float > &FrequencyBands, int32 NumFrequencyBands, FIntPoint IOId)
 Event triggered when frequency band data is ready for an audio I/O device.
void OnAmplitudesReady (const TArray< float > &Amplitudes, FIntPoint IOId)
 Event triggered when amplitude data is ready for an audio I/O device.
void OnPitchesReady (const TArray< float > &Pitches, FIntPoint IOId)
 Event triggered when pitch data is ready for an audio I/O device.
void OnBeatDetected (const TArray< float > &Beats, const TArray< bool > &BeatDetectedForChannel, FIntPoint IOId)
 Event triggered when a beat is detected in the audio data for an I/O device.

Protected Member Functions

virtual void BeginPlay () override
virtual void BeginDestroy () override
virtual void InitComputeShader_GameThread () override
virtual void InitComputeShader_RenderThread (FRHICommandListImmediate &RHICmdList) override
virtual void ExecuteComputeShader_GameThread (float DeltaTime) override
virtual void ExecuteComputeShader_RenderThread (FRHICommandListImmediate &RHICmdList) override
virtual void DisposeComputeShader_GameThread () override
virtual void DisposeComputeShader_RenderThread (FRHICommandListImmediate &RHICmdList) override
virtual bool SetConstantParameters () override
virtual bool SetDynamicParameters () override
virtual FString GetOwnerName () const override
virtual void OnAudioIOStatusChanged_Implementation (bool bIsActive, FIntPoint IOId) override
virtual void OnFrequencyBandsReady_Implementation (const TArray< float > &FrequencyBands, int32 NumFrequencyBands, FIntPoint IOId) override
virtual void OnAmplitudesReady_Implementation (const TArray< float > &Amplitudes, FIntPoint IOId) override
virtual void OnPitchesReady_Implementation (const TArray< float > &Pitches, FIntPoint IOId) override
virtual void OnBeatDetected_Implementation (const TArray< float > &Beats, const TArray< bool > &BeatDetectedForChannel, FIntPoint IOId) override
virtual TSoftObjectPtr< UNiagaraSystem > GetNiagaraSystem () const
Protected Member Functions inherited from AST_VisBase
virtual void PostInitializeComponents () override

Protected Attributes

FST_VJ_BoidCurrentParameters BoidCurrentParameters
FST_VJ_ReactiveBoidDynamicParameters ReactiveBoidDynamicParameters
TArray< FST_VJ_BoidItemBoidsArray
UNiagaraComponent * Niagara = nullptr
UMaterialInstanceDynamic * MatiD = nullptr
FST_VJ_PingPongBuffer BoidsPingPongBuffer
FST_VJ_BoidsRDGStateData BoidsRDGStateData
FST_AudioIOData_GameThread ST_AudioIOData_GT
FST_AudioIOBuffers_RenderThread ST_AudioIOBuffers_RT
Protected Attributes inherited from AST_VisComputeBase
bool bDebugSprite = true
bool bDebugBounds = true
bool bDebugDisplayInRuntime = false
FST_VJ_BoundsConstantParameters BoundsConstantParameters
float LastDeltaTime = 0.0f
UST_VJ_RPCSManagercachedRPCSManager = nullptr
Protected Attributes inherited from AST_VisBase
USceneComponent * Root = nullptr
bool bCustomBeginPlay = false
bool bSamplerActivates = false
bool bZeroSamplersDeactivates = false
int32 Default_AudioIOs = 0
int32 Registered_AudioIOs = 0

Additional Inherited Members

Static Public Member Functions inherited from AST_VisComputeBase
static bool IsPlaying (const UObject *WorldContextObject)

Detailed Description

An audio-reactive boids simulation actor that uses a managed compute shader to simulate boid behavior based on audio input.

Constructor & Destructor Documentation

◆ AST_C_VisAudioReactiveBoids()

AST_C_VisAudioReactiveBoids::AST_C_VisAudioReactiveBoids ( )

Sets default values for this actor's properties.

Member Function Documentation

◆ BeginDestroy()

void AST_C_VisAudioReactiveBoids::BeginDestroy ( )
overrideprotectedvirtual

Called when the actor is being destroyed.

Reimplemented from AST_VisComputeBase.

◆ BeginPlay()

void AST_C_VisAudioReactiveBoids::BeginPlay ( )
overrideprotectedvirtual

Called when the game starts or when spawned.

Reimplemented from AST_VisComputeBase.

◆ DisposeComputeShader_GameThread()

void AST_C_VisAudioReactiveBoids::DisposeComputeShader_GameThread ( )
overrideprotectedvirtual

Disposes of compute shader resources on the game thread.

Reimplemented from AST_VisComputeBase.

◆ DisposeComputeShader_RenderThread()

void AST_C_VisAudioReactiveBoids::DisposeComputeShader_RenderThread ( FRHICommandListImmediate & RHICmdList)
overrideprotectedvirtual

Disposes of compute shader resources on the render thread.

Reimplemented from AST_VisComputeBase.

◆ ExecuteComputeShader_GameThread()

void AST_C_VisAudioReactiveBoids::ExecuteComputeShader_GameThread ( float DeltaTime)
overrideprotectedvirtual

Executes the compute shader on the game thread.

Reimplemented from AST_VisComputeBase.

◆ ExecuteComputeShader_RenderThread()

void AST_C_VisAudioReactiveBoids::ExecuteComputeShader_RenderThread ( FRHICommandListImmediate & RHICmdList)
overrideprotectedvirtual

Executes the compute shader on the render thread.

Reimplemented from AST_VisComputeBase.

◆ GetNiagaraSystem()

TSoftObjectPtr< UNiagaraSystem > AST_C_VisAudioReactiveBoids::GetNiagaraSystem ( ) const
protectedvirtual

Returns the Niagara system asset used for the boids visualization.

Returns
A soft pointer to the Niagara system.

◆ GetOwnerName()

FString AST_C_VisAudioReactiveBoids::GetOwnerName ( ) const
inlineoverrideprotectedvirtual

Returns the owner's name for use in debugging or profiling.

Returns
The owner name as a string.

Reimplemented from AST_VisComputeBase.

◆ InitComputeShader_GameThread()

void AST_C_VisAudioReactiveBoids::InitComputeShader_GameThread ( )
overrideprotectedvirtual

Initializes the compute shader on the game thread.

Reimplemented from AST_VisComputeBase.

◆ InitComputeShader_RenderThread()

void AST_C_VisAudioReactiveBoids::InitComputeShader_RenderThread ( FRHICommandListImmediate & RHICmdList)
overrideprotectedvirtual

Initializes the compute shader on the render thread.

Reimplemented from AST_VisComputeBase.

◆ OnAmplitudesReady_Implementation()

void AST_C_VisAudioReactiveBoids::OnAmplitudesReady_Implementation ( const TArray< float > & Amplitudes,
FIntPoint IOId )
overrideprotectedvirtual

Called when amplitude data is ready from the audio IO.

Parameters
AmplitudesArray of amplitude values.
IOIdThe identifier of the audio IO.

◆ OnAudioIOStatusChanged_Implementation()

void AST_C_VisAudioReactiveBoids::OnAudioIOStatusChanged_Implementation ( bool bIsActive,
FIntPoint IOId )
overrideprotectedvirtual

Called when the audio IO system's status changes.

Parameters
bIsActiveWhether the audio IO system is active.
IOIdThe identifier of the audio IO.

◆ OnBeatDetected_Implementation()

void AST_C_VisAudioReactiveBoids::OnBeatDetected_Implementation ( const TArray< float > & Beats,
const TArray< bool > & BeatDetectedForChannel,
FIntPoint IOId )
overrideprotectedvirtual

Called when beats are detected.

Parameters
BeatsAn array of detected beat values.
BeatDetectedForChannelAn array of channels and if a beat was detected.
IOIdThe identifier of the I/O operation associated with the beats.

◆ OnFrequencyBandsReady_Implementation()

void AST_C_VisAudioReactiveBoids::OnFrequencyBandsReady_Implementation ( const TArray< float > & FrequencyBands,
int32 NumFrequencyBands,
FIntPoint IOId )
overrideprotectedvirtual

Called when frequency band data is ready from the audio IO.

Parameters
FrequencyBandsArray of frequency band values.
NumFrequencyBandsNumber of bands available.
IOIdThe identifier of the audio IO.

◆ OnPitchesReady_Implementation()

void AST_C_VisAudioReactiveBoids::OnPitchesReady_Implementation ( const TArray< float > & Pitches,
FIntPoint IOId )
overrideprotectedvirtual

Called when pitch data is ready from the audio IO.

Parameters
PitchesArray of pitch values.
IOIdThe identifier of the audio IO.

◆ SetConstantParameters()

bool AST_C_VisAudioReactiveBoids::SetConstantParameters ( )
overrideprotectedvirtual

Sets constant (non-changing) parameters for the compute shader.

Returns
True if successful, false otherwise.

Reimplemented from AST_VisBase.

◆ SetDynamicParameters()

bool AST_C_VisAudioReactiveBoids::SetDynamicParameters ( )
overrideprotectedvirtual

Sets dynamic (changing per-frame) parameters for the compute shader.

Returns
True if successful, false otherwise.

Reimplemented from AST_VisBase.

Member Data Documentation

◆ BoidCurrentParameters

FST_VJ_BoidCurrentParameters AST_C_VisAudioReactiveBoids::BoidCurrentParameters
protected

Current boid simulation parameters.

◆ BoidsArray

TArray<FST_VJ_BoidItem> AST_C_VisAudioReactiveBoids::BoidsArray
protected

Array of boid items for simulation and visualization.

◆ BoidsPingPongBuffer

FST_VJ_PingPongBuffer AST_C_VisAudioReactiveBoids::BoidsPingPongBuffer
protected

Ping-pong buffer for boid simulation data swapping between frames.

◆ BoidsRDGStateData

FST_VJ_BoidsRDGStateData AST_C_VisAudioReactiveBoids::BoidsRDGStateData
protected

RDG state data used by the boids compute shader.

◆ MatiD

UMaterialInstanceDynamic* AST_C_VisAudioReactiveBoids::MatiD = nullptr
protected

Material Instance Dynamic for colouring the boids.

◆ Niagara

UNiagaraComponent* AST_C_VisAudioReactiveBoids::Niagara = nullptr
protected

Niagara component for rendering the boids.

◆ ReactiveBoidDynamicParameters

FST_VJ_ReactiveBoidDynamicParameters AST_C_VisAudioReactiveBoids::ReactiveBoidDynamicParameters
protected

Dynamic parameters that react to audio input.

◆ ST_AudioIOBuffers_RT

FST_AudioIOBuffers_RenderThread AST_C_VisAudioReactiveBoids::ST_AudioIOBuffers_RT
protected

Audio IO buffers stored on the render thread.

◆ ST_AudioIOData_GT

FST_AudioIOData_GameThread AST_C_VisAudioReactiveBoids::ST_AudioIOData_GT
protected

Audio IO data stored on the game thread.


The documentation for this class was generated from the following files:
  • H:/Games/Unreal/Aaron/FunWithShaders/Plugins/ST_VJMaster/Source/ST_AudioVisualisation/Public/Compute/Vis/ST_C_VisAudioReactiveBoids.h
  • H:/Games/Unreal/Aaron/FunWithShaders/Plugins/ST_VJMaster/Source/ST_AudioVisualisation/Private/Compute/Vis/ST_C_VisAudioReactiveBoids.cpp