pub struct Pitch;Expand description
weirdnet.pitch: moves the pitch of a sound.
| Parameter | Range | Default |
|---|---|---|
semitones | -24 to +24 | 0 |
cents | -100 to +100 | 0 |
preserve_length | on or off | on |
quality | fast or good (with preserve_length only) | good |
The shift is semitones + cents / 100 semitones, a frequency ratio of 2^(shift / 12).
- With
preserve_lengthon the sound keeps its length and only the pitch moves (Signalsmith Stretch throughweirdnet-dsp, so large shifts of a bass drum smear, and attacks soften a little). This needs the crate featurestretch, on by default; without it this mode is an error. - With it off the sound is resampled (cubic interpolation), like a tape speed change: the length changes by
1 / ratio, and no artefacts beyond the interpolation. It works without thestretchfeature.
A shift of zero returns the input’s samples unchanged (shared, not copied).
Trait Implementations§
Source§impl Plugin for Pitch
impl Plugin for Pitch
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
The stable id, for example
"weirdnet.gain". Saved in projects, so it never changes.Source§fn process(
&self,
input: &Waveform,
values: &ParamValues,
) -> Result<Waveform, PluginError>
fn process( &self, input: &Waveform, values: &ParamValues, ) -> Result<Waveform, PluginError>
Processes
input. values are already resolved against Plugin::params: complete, typed and in range.
Returns a new waveform (which may share the input’s samples when nothing changed) or an error.Auto Trait Implementations§
impl Forget for Pitch
impl Freeze for Pitch
impl Move for Pitch
impl RefUnwindSafe for Pitch
impl Send for Pitch
impl Sync for Pitch
impl Unpin for Pitch
impl UnsafeUnpin for Pitch
impl UnwindSafe for Pitch
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