Skip to main content

Pitch

Struct Pitch 

Source
pub struct Pitch;
Expand description

weirdnet.pitch: moves the pitch of a sound.

ParameterRangeDefault
semitones-24 to +240
cents-100 to +1000
preserve_lengthon or offon
qualityfast or good (with preserve_length only)good

The shift is semitones + cents / 100 semitones, a frequency ratio of 2^(shift / 12).

  • With preserve_length on the sound keeps its length and only the pitch moves (Signalsmith Stretch through weirdnet-dsp, so large shifts of a bass drum smear, and attacks soften a little). This needs the crate feature stretch, 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 the stretch feature.

A shift of zero returns the input’s samples unchanged (shared, not copied).

Trait Implementations§

Source§

impl Plugin for Pitch

Source§

fn id(&self) -> &'static str

The stable id, for example "weirdnet.gain". Saved in projects, so it never changes.
Source§

fn params(&self) -> &[ParamSpec]

The parameters this plugin takes.
Source§

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.
Source§

fn version(&self) -> u32

A version that changes whenever the output for the same input and values would change. It is part of the cache key.

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.