Struct musical_note::ResolvedScale
source · pub struct ResolvedScale {
pub key: Key,
pub degree_midi: [u8; 7],
pub degree_notes: [(NoteName, Accidental); 7],
pub used_accidentals: Vec<Accidental>,
}Expand description
Concrete Scale representation, based on the given root note.
Used to estimate alteration for notes, can be alterated by scale rules.
Fields
key: Keydegree_midi: [u8; 7]0..12 midi bytes, representing every grade of the scale.
E.g. for C-Dur it would be: [0, 2, 4, 5, 7, 9, 11],
and for A-moll: [9, 11, 0, 2, 4, 5, 7]
degree_notes: [(NoteName, Accidental); 7]the same, but, holding Tuples of note names and accidentals.
used_accidentals: Vec<Accidental>Collects accidentals, used for degrees to estimate, which alteration of non-degree notes is preferable. TODO: think on using this as weight.
Implementations
sourceimpl ResolvedScale
impl ResolvedScale
pub fn resolve_pitch(
&self,
notes_map: &NotesMap,
midi_note: u8,
octave: Octave
) -> ResolvedNote
Trait Implementations
sourceimpl Clone for ResolvedScale
impl Clone for ResolvedScale
sourcefn clone(&self) -> ResolvedScale
fn clone(&self) -> ResolvedScale
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for ResolvedScale
impl Debug for ResolvedScale
sourceimpl PartialEq<ResolvedScale> for ResolvedScale
impl PartialEq<ResolvedScale> for ResolvedScale
sourcefn eq(&self, other: &ResolvedScale) -> bool
fn eq(&self, other: &ResolvedScale) -> bool
impl Eq for ResolvedScale
impl StructuralEq for ResolvedScale
impl StructuralPartialEq for ResolvedScale
Auto Trait Implementations
impl RefUnwindSafe for ResolvedScale
impl Send for ResolvedScale
impl Sync for ResolvedScale
impl Unpin for ResolvedScale
impl UnwindSafe for ResolvedScale
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more