pub struct AffinePitchMap {
pub multiplier: u8,
pub addend: u8,
}Expand description
An affine pitch-class map x -> ax + b mod 12.
Fields§
§multiplier: u8Multiplicative factor a, reduced modulo twelve.
addend: u8Additive factor b, reduced modulo twelve.
Implementations§
Source§impl AffinePitchMap
impl AffinePitchMap
Sourcepub const fn new(multiplier: u8, addend: u8) -> Self
pub const fn new(multiplier: u8, addend: u8) -> Self
Constructs an affine pitch-class map with canonical modulo-twelve factors.
Sourcepub const fn is_bijective(self) -> bool
pub const fn is_bijective(self) -> bool
Returns true exactly when the map is bijective over pitch classes.
Sourcepub fn apply(self, row: &ToneRow) -> PitchTransformOutput
pub fn apply(self, row: &ToneRow) -> PitchTransformOutput
Applies the affine map to row, returning a strict row only for bijections.
Trait Implementations§
Source§impl Clone for AffinePitchMap
impl Clone for AffinePitchMap
Source§fn clone(&self) -> AffinePitchMap
fn clone(&self) -> AffinePitchMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AffinePitchMap
Source§impl Debug for AffinePitchMap
impl Debug for AffinePitchMap
impl Eq for AffinePitchMap
Source§impl Hash for AffinePitchMap
impl Hash for AffinePitchMap
Source§impl PartialEq for AffinePitchMap
impl PartialEq for AffinePitchMap
impl StructuralPartialEq for AffinePitchMap
Auto Trait Implementations§
impl Freeze for AffinePitchMap
impl RefUnwindSafe for AffinePitchMap
impl Send for AffinePitchMap
impl Sync for AffinePitchMap
impl Unpin for AffinePitchMap
impl UnsafeUnpin for AffinePitchMap
impl UnwindSafe for AffinePitchMap
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