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: u14
Implementations§
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.