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

Phase-vocoder spectral freeze: capture one analysis frame and sustain it indefinitely with a SEAMLESS, evolving loop — no loop boundary, no click. More...

#include <gpu_spectral_freeze.hpp>

Public Member Functions

bool prepare (uint32_t fft_size, uint32_t hop, signal::WindowFunction::Type window=signal::WindowFunction::Type::hann, render::GpuCompute *shared_device=nullptr)
 shared_device (optional) reuses an existing GpuCompute so this freeze and a sibling spectral primitive don't each spin up a device; must be initialized and outlive the freeze.
bool gpu_available () const
bool device_usable () const
 False once the prepared device is lost or its generation changed.
uint32_t fft_size () const
uint32_t hop () const
bool is_captured () const
bool capture (const float *frame_in)
 Analyze frame_in (fft_size real samples) and capture its magnitude + phase as the frozen content.
bool render (float *frame_out, float phase_jitter=0.0f)
 Render the next synthesis frame (fft_size real samples), advancing each bin's phase by its nominal per-hop increment.

Detailed Description

Phase-vocoder spectral freeze: capture one analysis frame and sustain it indefinitely with a SEAMLESS, evolving loop — no loop boundary, no click.

capture() stores per-bin magnitude + phase; each render() advances every bin's phase by its nominal frequency for one synthesis hop (with optional jitter to avoid a static/metallic sound), rebuilds the complex spectrum, and runs a GPU STFT synthesis. The caller overlap-adds successive render() frames at the hop. Built on GpuStft; not real-time-safe (blocks on readback) — for the worker / offline use. The GPU-resident foundation for the hardcore multi-layer "hyper-freeze" modes.

Member Function Documentation

◆ capture()

bool pulp::gpu_audio::GpuSpectralFreeze::capture ( const float * frame_in)

Analyze frame_in (fft_size real samples) and capture its magnitude + phase as the frozen content.

Returns false if not GPU-ready.

◆ device_usable()

bool pulp::gpu_audio::GpuSpectralFreeze::device_usable ( ) const
inline

False once the prepared device is lost or its generation changed.

◆ fft_size()

uint32_t pulp::gpu_audio::GpuSpectralFreeze::fft_size ( ) const
inline

◆ gpu_available()

bool pulp::gpu_audio::GpuSpectralFreeze::gpu_available ( ) const
inline

◆ hop()

uint32_t pulp::gpu_audio::GpuSpectralFreeze::hop ( ) const
inline

◆ is_captured()

bool pulp::gpu_audio::GpuSpectralFreeze::is_captured ( ) const
inline

◆ prepare()

bool pulp::gpu_audio::GpuSpectralFreeze::prepare ( uint32_t fft_size,
uint32_t hop,
signal::WindowFunction::Type window = signal::WindowFunction::Type::hann,
render::GpuCompute * shared_device = nullptr )

shared_device (optional) reuses an existing GpuCompute so this freeze and a sibling spectral primitive don't each spin up a device; must be initialized and outlive the freeze.

null = create + own a device. The device generation is recorded here; capture() and render() refuse once the device is lost or re-initialized (see GpuStft::prepare).

◆ render()

bool pulp::gpu_audio::GpuSpectralFreeze::render ( float * frame_out,
float phase_jitter = 0.0f )

Render the next synthesis frame (fft_size real samples), advancing each bin's phase by its nominal per-hop increment.

phase_jitter (0..1) adds per-hop phase wander using the shared spectral-jitter contract (see spectral_jitter.hpp): a full-turn-at-1 stateless-hash wander identical to the SpectralStack, so the knob means the same thing (and sounds the same) here as in the stack. Returns false if nothing captured or not GPU-ready.


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