Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::gpu_audio::SpectralStack Class Referenceabstract

A stack of N captured spectral "moments" (layers) that can be sustained and morphed. More...

#include <spectral_stack.hpp>

Public Member Functions

virtual ~SpectralStack ()=default
virtual uint32_t fft_size () const =0
virtual uint32_t num_layers () const =0
virtual bool available () const =0
 True if this stack's compute backend is live.
virtual bool capture (uint32_t layer, const float *frame_in)=0
 Analyze frame_in (fft_size real samples) with the analysis window and freeze its magnitude + phase into layer, activating it.
virtual void clear (uint32_t layer)=0
 Deactivate a layer (its magnitude goes silent; phase keeps advancing).
virtual bool layer_active (uint32_t layer) const =0
virtual bool render (float *frame_out, const float *weights, float smear, float jitter)=0
 Advance + smear + weighted-sum the stack into frame_out (fft_size real samples).

Detailed Description

A stack of N captured spectral "moments" (layers) that can be sustained and morphed.

capture() freezes the windowed spectrum of one frame into a layer; render() advances every layer's phase, optionally smears (magnitude blur) and jitters each layer, weights the layers, and synthesizes ONE combined real frame. This is the authoring surface shared by the CPU reference (CpuSpectralStack) and the GPU-resident batched engine (GpuSpectralStack) so the framing/host code is identical regardless of where the per-bin work runs.

Constructor & Destructor Documentation

◆ ~SpectralStack()

virtual pulp::gpu_audio::SpectralStack::~SpectralStack ( )
virtualdefault

Member Function Documentation

◆ available()

virtual bool pulp::gpu_audio::SpectralStack::available ( ) const
pure virtual

True if this stack's compute backend is live.

The CPU stack is always available; the GPU stack is available only with a GPU device.

Implemented in pulp::gpu_audio::CpuSpectralStack, and pulp::gpu_audio::GpuSpectralStack.

◆ capture()

virtual bool pulp::gpu_audio::SpectralStack::capture ( uint32_t layer,
const float * frame_in )
pure virtual

Analyze frame_in (fft_size real samples) with the analysis window and freeze its magnitude + phase into layer, activating it.

Implemented in pulp::gpu_audio::CpuSpectralStack, and pulp::gpu_audio::GpuSpectralStack.

◆ clear()

virtual void pulp::gpu_audio::SpectralStack::clear ( uint32_t layer)
pure virtual

Deactivate a layer (its magnitude goes silent; phase keeps advancing).

Implemented in pulp::gpu_audio::CpuSpectralStack, and pulp::gpu_audio::GpuSpectralStack.

◆ fft_size()

virtual uint32_t pulp::gpu_audio::SpectralStack::fft_size ( ) const
pure virtual

◆ layer_active()

virtual bool pulp::gpu_audio::SpectralStack::layer_active ( uint32_t layer) const
pure virtual

◆ num_layers()

virtual uint32_t pulp::gpu_audio::SpectralStack::num_layers ( ) const
pure virtual

◆ render()

virtual bool pulp::gpu_audio::SpectralStack::render ( float * frame_out,
const float * weights,
float smear,
float jitter )
pure virtual

Advance + smear + weighted-sum the stack into frame_out (fft_size real samples).

weights (length num_layers) scales each layer; smear (0..1) blurs magnitude across frequency; jitter (0..1) adds phase wander. Returns false if no layer is active or the backend is unavailable.

Implemented in pulp::gpu_audio::CpuSpectralStack, and pulp::gpu_audio::GpuSpectralStack.


The documentation for this class was generated from the following file: