pub enum FunctionMap {
Major,
MinorNatural,
MinorHarmonic,
MinorMelodicAsc,
Dorian,
Phrygian,
Lydian,
Mixolydian,
Locrian,
Custom(Scale),
}Expand description
Named diatonic function (mode) used to remap scale degrees onto pitches.
Variants§
Major
Major (Ionian) function.
MinorNatural
Natural minor (Aeolian) function.
MinorHarmonic
Harmonic minor function.
MinorMelodicAsc
Ascending melodic minor function.
Dorian
Dorian mode function.
Phrygian
Phrygian mode function.
Lydian
Lydian mode function.
Mixolydian
Mixolydian mode function.
Locrian
Locrian mode function.
Custom(Scale)
User-supplied scale used directly as the function.
Implementations§
Source§impl FunctionMap
impl FunctionMap
Sourcepub fn scale_for_key(&self, key: &Key) -> Scale
pub fn scale_for_key(&self, key: &Key) -> Scale
Builds the concrete Scale this function produces for the given key.
Sourcepub fn degree_to_pitch(
&self,
degree: usize,
key: &Key,
octave: i16,
) -> Result<Pitch, PitchScaleError>
pub fn degree_to_pitch( &self, degree: usize, key: &Key, octave: i16, ) -> Result<Pitch, PitchScaleError>
Resolves a scale degree to a concrete pitch at the given octave.
Trait Implementations§
Source§impl Clone for FunctionMap
impl Clone for FunctionMap
Source§fn clone(&self) -> FunctionMap
fn clone(&self) -> FunctionMap
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 moreSource§impl Debug for FunctionMap
impl Debug for FunctionMap
impl Eq for FunctionMap
Source§impl PartialEq for FunctionMap
impl PartialEq for FunctionMap
impl StructuralPartialEq for FunctionMap
Auto Trait Implementations§
impl Freeze for FunctionMap
impl RefUnwindSafe for FunctionMap
impl Send for FunctionMap
impl Sync for FunctionMap
impl Unpin for FunctionMap
impl UnsafeUnpin for FunctionMap
impl UnwindSafe for FunctionMap
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