SignalsmithStretch

Struct SignalsmithStretch 

Source
pub struct SignalsmithStretch<T: Float> { /* private fields */ }
Expand description

Main time-stretching and pitch-shifting processor

Implementations§

Source§

impl<T: Float + FromPrimitive + NumCast + AddAssign> SignalsmithStretch<T>

Source

pub fn new() -> Self

Create a new stretch processor

Source

pub fn block_samples(&self) -> usize

Get the block size in samples

Source

pub fn interval_samples(&self) -> usize

Get the interval size in samples

Source

pub fn input_latency(&self) -> usize

Get the input latency

Source

pub fn output_latency(&self) -> usize

Get the output latency

Source

pub fn reset(&mut self)

Reset the processor state

Source

pub fn preset_default( &mut self, n_channels: usize, sample_rate: T, split_computation: bool, )

Configure with default preset

Source

pub fn preset_cheaper( &mut self, n_channels: usize, sample_rate: T, split_computation: bool, )

Configure with cheaper preset

Source

pub fn configure( &mut self, n_channels: usize, block_samples: usize, interval_samples: usize, split_computation: bool, )

Manual configuration

Source

pub fn set_transpose_factor(&mut self, multiplier: T, tonality_limit: T)

Set transpose factor for pitch shifting

Source

pub fn set_transpose_semitones(&mut self, semitones: T, tonality_limit: T)

Set transpose in semitones

Source

pub fn set_freq_map<F>(&mut self, input_to_output: F)
where F: Fn(T) -> T + 'static + Send + Sync,

Set custom frequency mapping function

Source

pub fn set_formant_factor(&mut self, multiplier: T, compensate_pitch: bool)

Set formant factor

Source

pub fn set_formant_semitones(&mut self, semitones: T, compensate_pitch: bool)

Set formant shift in semitones

Source

pub fn set_formant_base(&mut self, base_freq: T)

Set formant base frequency

Source

pub fn process<I, O>( &mut self, inputs: I, input_samples: usize, outputs: O, output_samples: usize, )
where I: AsRef<[Vec<T>]>, O: AsMut<[Vec<T>]>,

Main processing function (simplified)

Trait Implementations§

Source§

impl<T: Float + FromPrimitive + NumCast + AddAssign> Default for SignalsmithStretch<T>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> Freeze for SignalsmithStretch<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for SignalsmithStretch<T>

§

impl<T> Send for SignalsmithStretch<T>
where T: Send,

§

impl<T> Sync for SignalsmithStretch<T>
where T: Sync,

§

impl<T> Unpin for SignalsmithStretch<T>
where T: Unpin,

§

impl<T> !UnwindSafe for SignalsmithStretch<T>

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