pub struct PitchShifter { /* private fields */ }Expand description
Granular pitch shifter
Real-time pitch shifting using two overlapping grains with crossfade. Uses a circular delay buffer with variable playback rate.
§Latency and aliasing (Q033)
The wet path is delayed: each grain reads from behind the write pointer by at
least half the window, and further behind for pitch-up (by (rate-1)·window)
so a grain’s read pointer can never overtake the write pointer within its
lifetime. To keep that margin inside the ring buffer, the effective window is
automatically shortened at high pitch-up ratios. No oversampling is
performed, so the resampled grains alias; the effect is intended as a
character/lo-fi shifter, not a transparent one. Pitch is bounded to ±24
semitones (playback rate 0.25×–4×).
§Ports
- Input 0: Audio input
- Input 1: Pitch shift in semitones (-24 to +24, bipolar CV maps to range)
- Input 2: Window size (0-1 CV maps to 10-100ms)
- Input 3: Wet/dry mix (0-1)
- Output 10: Audio output
Implementations§
Trait Implementations§
Source§impl Default for PitchShifter
impl Default for PitchShifter
Source§impl GraphModule for PitchShifter
impl GraphModule for PitchShifter
Source§fn tick(&mut self, inputs: &PortValues, outputs: &mut PortValues)
fn tick(&mut self, inputs: &PortValues, outputs: &mut PortValues)
Process one sample given port values
Source§fn set_sample_rate(&mut self, sample_rate: f64)
fn set_sample_rate(&mut self, sample_rate: f64)
Set sample rate
Source§fn process_block(
&mut self,
inputs: &BlockPortValues,
outputs: &mut BlockPortValues,
frames: usize,
)
fn process_block( &mut self, inputs: &BlockPortValues, outputs: &mut BlockPortValues, frames: usize, )
Process a block of samples (optional optimization). Read more
Source§fn breaks_feedback_cycle(&self) -> bool
fn breaks_feedback_cycle(&self) -> bool
Whether this module breaks a feedback cycle in the patch graph. Read more
Source§fn serialize_state(&self) -> Option<Value>
fn serialize_state(&self) -> Option<Value>
Available on crate feature
alloc only.Serialize module state (alloc feature only)
Source§fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
Available on crate feature
alloc only.Deserialize module state (alloc feature only)
Source§fn introspect(&self) -> Option<&dyn ModuleIntrospection>
fn introspect(&self) -> Option<&dyn ModuleIntrospection>
Available on crate feature
alloc only.Downcast this module to its
ModuleIntrospection view, if it exposes one. Read moreSource§fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
Available on crate feature
alloc only.Mutable companion to
introspect, used to set internal parameters.Source§impl ModuleIntrospection for PitchShifter
Available on crate feature alloc only.
impl ModuleIntrospection for PitchShifter
Available on crate feature
alloc only.Auto Trait Implementations§
impl Freeze for PitchShifter
impl RefUnwindSafe for PitchShifter
impl Send for PitchShifter
impl Sync for PitchShifter
impl Unpin for PitchShifter
impl UnsafeUnpin for PitchShifter
impl UnwindSafe for PitchShifter
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