pub struct Stretch { /* private fields */ }Expand description
WSOLA’s grid at one sample rate.
Implementations§
Source§impl Stretch
impl Stretch
Sourcepub fn new(sample_rate: u32) -> Self
pub fn new(sample_rate: u32) -> Self
A 20 ms hop, 40 ms window and 10 ms tolerance at sample_rate.
Sourcepub fn grains(&self, first: i64, end: i64) -> (i64, i64)
pub fn grains(&self, first: i64, end: i64) -> (i64, i64)
The first and last grains whose windows touch output samples [first, end).
Sourcepub const fn chain(segment: i64) -> (i64, i64)
pub const fn chain(segment: i64) -> (i64, i64)
The inclusive grain range segment’s chain runs over, warm-up included.
Sourcepub fn reach(
&self,
first: i64,
last: i64,
position: impl Fn(i64) -> i64,
) -> (i64, i64)
pub fn reach( &self, first: i64, last: i64, position: impl Fn(i64) -> i64, ) -> (i64, i64)
The signal samples [from, to) that deciding and reading grains first ..= last can
touch, with grain k at position(k).
Sourcepub fn reach_output(
&self,
first: i64,
end: i64,
position: impl Fn(i64) -> i64,
) -> (i64, i64)
pub fn reach_output( &self, first: i64, end: i64, position: impl Fn(i64) -> i64, ) -> (i64, i64)
The signal samples [from, to) that reading output [first, end) can touch, including
the full chains of their segments.
Sourcepub fn offsets(
&self,
segment: i64,
position: impl Fn(i64) -> i64,
mono: StretchSignal<'_>,
) -> Vec<i64>
pub fn offsets( &self, segment: i64, position: impl Fn(i64) -> i64, mono: StretchSignal<'_>, ) -> Vec<i64>
The offsets segment’s chain gives its grains, in order, searched on mono.
Sourcepub fn overlap_add(
&self,
first: i64,
output: &mut [f32],
grains: impl IntoIterator<Item = (i64, i64)>,
signal: StretchSignal<'_>,
)
pub fn overlap_add( &self, first: i64, output: &mut [f32], grains: impl IntoIterator<Item = (i64, i64)>, signal: StretchSignal<'_>, )
Adds each windowed grain (k, read) from signal into output, which starts at output
sample first.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stretch
impl RefUnwindSafe for Stretch
impl Send for Stretch
impl Sync for Stretch
impl Unpin for Stretch
impl UnsafeUnpin for Stretch
impl UnwindSafe for Stretch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more