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

Spectral morph: capture two spectra (A and B) and render a blend at position t ∈ [0,1] — the signature "morph between two sounds" effect. More...

#include <gpu_spectral_morph.hpp>

Public Member Functions

bool prepare (uint32_t fft_size, signal::WindowFunction::Type window=signal::WindowFunction::Type::hann, render::GpuCompute *shared_device=nullptr)
 shared_device (optional) reuses an existing GpuCompute so this morph and a sibling spectral primitive don't each spin up a device; must be initialized and outlive the morph.
bool gpu_available () const
bool device_usable () const
 False once the prepared device is lost or its generation changed.
uint32_t fft_size () const
bool ready () const
bool capture_a (const float *frame_in)
bool capture_b (const float *frame_in)
bool render (float t, float *frame_out)
 Render the morph at position t (clamped to [0,1]) into frame_out (fft_size real samples).

Detailed Description

Spectral morph: capture two spectra (A and B) and render a blend at position t ∈ [0,1] — the signature "morph between two sounds" effect.

Composed from GpuStft: capture_a/capture_b run GPU STFT analysis; render(t) linearly interpolates the stored complex spectra and runs a GPU STFT synthesis. t=0 → A, t=1 → B. Built on the GPU spectral toolkit; not real-time-safe (blocks on readback) — for the worker / offline use.

Member Function Documentation

◆ capture_a()

bool pulp::gpu_audio::GpuSpectralMorph::capture_a ( const float * frame_in)

◆ capture_b()

bool pulp::gpu_audio::GpuSpectralMorph::capture_b ( const float * frame_in)

◆ device_usable()

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

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

◆ fft_size()

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

◆ gpu_available()

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

◆ prepare()

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

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

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).

◆ ready()

bool pulp::gpu_audio::GpuSpectralMorph::ready ( ) const
inline

◆ render()

bool pulp::gpu_audio::GpuSpectralMorph::render ( float t,
float * frame_out )

Render the morph at position t (clamped to [0,1]) into frame_out (fft_size real samples).

Returns false if both endpoints aren't captured or not GPU-ready.


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