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: Key§degree_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§
Source§impl ResolvedScale
impl ResolvedScale
pub fn resolve_pitch( &self, notes_map: &NotesMap, midi_note: u8, octave: Octave, ) -> ResolvedNote
Trait Implementations§
Source§impl Clone for ResolvedScale
impl Clone for ResolvedScale
Source§fn clone(&self) -> ResolvedScale
fn clone(&self) -> ResolvedScale
Returns a duplicate of the value. Read more
1.0.0 · 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 ResolvedScale
impl Debug for ResolvedScale
Source§impl<'de> Deserialize<'de> for ResolvedScale
impl<'de> Deserialize<'de> for ResolvedScale
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResolvedScale
impl PartialEq for ResolvedScale
Source§impl Serialize for ResolvedScale
impl Serialize for ResolvedScale
impl Eq for ResolvedScale
impl StructuralPartialEq for ResolvedScale
Auto Trait Implementations§
impl Freeze for ResolvedScale
impl RefUnwindSafe for ResolvedScale
impl Send for ResolvedScale
impl Sync for ResolvedScale
impl Unpin for ResolvedScale
impl UnwindSafe for ResolvedScale
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