pub struct PitchBend(pub u14);Expand description
The value of a pitch bend, represented as 14 bits.
A value of 0x0000 indicates full bend downwards.
A value of 0x2000 indicates no bend.
A value of 0x3FFF indicates full bend upwards.
Tuple Fields§
§0: u14Implementations§
Source§impl PitchBend
impl PitchBend
Sourcepub const fn min_raw_value() -> PitchBend
pub const fn min_raw_value() -> PitchBend
The minimum value of 0x0000, indicating full bend downwards.
Sourcepub const fn mid_raw_value() -> PitchBend
pub const fn mid_raw_value() -> PitchBend
The middle value of 0x2000, indicating no bend.
Sourcepub const fn max_raw_value() -> PitchBend
pub const fn max_raw_value() -> PitchBend
The maximum value of 0x3FFF, indicating full bend upwards.
Sourcepub fn from_int(int: i16) -> PitchBend
pub fn from_int(int: i16) -> PitchBend
Create a PitchBend value from an int in the range [-0x2000, 0x1FFF].
Integers outside this range will be clamped.
Sourcepub fn from_f32(float: f32) -> PitchBend
pub fn from_f32(float: f32) -> PitchBend
Create a PitchBend value from a number in the range [-1.0, 1.0).
Floats outside this range will be clamped.
Trait Implementations§
impl Copy for PitchBend
impl Eq for PitchBend
impl StructuralPartialEq for PitchBend
Auto Trait Implementations§
impl Freeze for PitchBend
impl RefUnwindSafe for PitchBend
impl Send for PitchBend
impl Sync for PitchBend
impl Unpin for PitchBend
impl UnwindSafe for PitchBend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more