Skip to main content

SpectralDelay

Struct SpectralDelay 

Source
pub struct SpectralDelay<T: Transcendental, const BUF_SIZE: usize, const MAX_DELAY: usize> { /* private fields */ }
Expand description

Spectral delay effect — applies different delay times to different frequency bins.

Stores a circular buffer of past FFT frames. Each bin’s output is a mix of the current bin and a delayed version with optional feedback.

§Type parameters

  • T — sample type (f32 or f64)
  • BUF_SIZE — processing block size in samples
  • MAX_DELAY — maximum delay in FFT frames

Implementations§

Source§

impl<T: Transcendental, const BUF_SIZE: usize, const MAX_DELAY: usize> SpectralDelay<T, BUF_SIZE, MAX_DELAY>

Source

pub fn new() -> Self

Create a new spectral delay.

§Panics

Panics if MAX_DELAY is 0.

Source

pub fn set_mix(&mut self, mix: f32)

Set wet/dry mix (0.0 = dry, 1.0 = wet).

Source

pub fn set_feedback(&mut self, feedback: f32)

Set feedback amount (0.0 = no feedback, 0.99 = near infinite).

Source

pub fn fft_size(&self) -> usize

Returns the FFT size.

Source

pub fn process(&mut self, input: &[T], output: &mut [T])

Process one block of samples.

Combines the current spectrum with a delayed spectrum bin-by-bin. Lower-frequency bins can have longer delays than higher ones, creating unique spatial effects.

Trait Implementations§

Source§

impl<T: Transcendental, const BUF_SIZE: usize, const MAX_DELAY: usize> Algorithm<T> for SpectralDelay<T, BUF_SIZE, MAX_DELAY>

Source§

fn process( &mut self, input: Option<&[T]>, output: &mut [T], ) -> ProcessResult<()>

Process one block of signal. Read more
Source§

fn reset(&mut self)

Reset the algorithm to its initial state. Read more
Source§

fn metadata(&self) -> AlgorithmMetadata

Descriptive metadata (defaults to empty).
Source§

fn apply_command(&mut self, _value: T)

Receive a real-time command value from the control path. Read more
Source§

fn init(&mut self, _sample_rate: f32)

Initialise the algorithm with a sample rate. Read more
Source§

impl<T: Transcendental, const BUF_SIZE: usize, const MAX_DELAY: usize> Default for SpectralDelay<T, BUF_SIZE, MAX_DELAY>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> Freeze for SpectralDelay<T, BUF_SIZE, MAX_DELAY>
where T: Freeze,

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> RefUnwindSafe for SpectralDelay<T, BUF_SIZE, MAX_DELAY>
where T: RefUnwindSafe,

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> Send for SpectralDelay<T, BUF_SIZE, MAX_DELAY>

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> Sync for SpectralDelay<T, BUF_SIZE, MAX_DELAY>

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> Unpin for SpectralDelay<T, BUF_SIZE, MAX_DELAY>
where T: Unpin,

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> UnsafeUnpin for SpectralDelay<T, BUF_SIZE, MAX_DELAY>
where T: UnsafeUnpin,

§

impl<T, const BUF_SIZE: usize, const MAX_DELAY: usize> UnwindSafe for SpectralDelay<T, BUF_SIZE, MAX_DELAY>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert to &dyn std::any::Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert to &mut dyn std::any::Any
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V