pub struct Voicing { /* private fields */ }Implementations§
Source§impl Voicing
The voicing of a chord describes the order of the individual notes within
the chord. The same chord can be voiced in different ways, i.e. there are
several ways to play the same chord on the ukulele.
https://en.wikipedia.org/wiki/Voicing_(music)
impl Voicing
The voicing of a chord describes the order of the individual notes within the chord. The same chord can be voiced in different ways, i.e. there are several ways to play the same chord on the ukulele. https://en.wikipedia.org/wiki/Voicing_(music)
pub fn new(fret_pattern: impl Into<FretPattern>, tuning: Tuning) -> Self
pub fn uke_strings(&self) -> Iter<'_, UkeString>
pub fn roots(&self) -> impl Iterator<Item = Note> + '_
pub fn frets(&self) -> impl Iterator<Item = FretID> + '_
pub fn notes(&self) -> impl Iterator<Item = Note> + '_
Sourcepub fn count_pressed_strings(&self) -> usize
pub fn count_pressed_strings(&self) -> usize
Return the overall number of strings pressed down when playing this voicing.
Sourcepub fn get_min_pressed_fret(&self) -> FretID
pub fn get_min_pressed_fret(&self) -> FretID
Return the lowest fret at which a string is pressed down.
Sourcepub fn get_min_fret(&self) -> FretID
pub fn get_min_fret(&self) -> FretID
Return the lowest fret involved in playing the chord voicing (is 0 if the chord is open).
pub fn get_max_fret(&self) -> FretID
pub fn get_span(&self) -> FretID
Sourcepub fn spells_out(&self, chord: &Chord) -> bool
pub fn spells_out(&self, chord: &Chord) -> bool
Return true if the voicing contains all the notes needed
to play the given chord.
pub fn get_chords(&self) -> Vec<Chord>
Sourcepub fn has_barre(&self) -> bool
pub fn has_barre(&self) -> bool
Return true if the current voicing requires the player to play a barre chord.
For this, I took some inspiration from
https://github.com/hyvyys/chord-fingering/blob/master/src/barre.js
Sourcepub fn fingers_on_strings(&self) -> [u8; 4]
pub fn fingers_on_strings(&self) -> [u8; 4]
Compute a fingering for the current voicing, i.e. assign the player’s fingers to the positions on the fretboard that have to be pressed down. The return value is an array of numbers representing the fingers on the strings (represented by the indexes of the array). This assumes that each chord voicing has a unique fingering (which is not true in reality - often several fingerings are possible). My fingering strategy here is based on my own way to play certain chords. For example, I tend to avoid barre chords if possible, e.g. I play the G major chord as 0132 and not as 0121.
Sourcepub fn semitone_distance(&self, other: Self) -> u8
pub fn semitone_distance(&self, other: Self) -> u8
Return the distance in semitones between this and another voicing. It’s computed by simply summing up the distances between the frets that are pressed down on the same string when moving from one voicing to the other. Inspired by http://www.petecorey.com/blog/2018/07/30/voice-leading-with-elixir/
pub fn fingering_distance(&self, other: Self) -> u8
pub fn distance(&self, other: Self) -> Distance
Trait Implementations§
Source§impl Default for Voicing
The default implementation is used to easily create an “empty” start and end node
in the voicing graph.
impl Default for Voicing
The default implementation is used to easily create an “empty” start and end node in the voicing graph.
Source§impl Ord for Voicing
impl Ord for Voicing
Source§impl PartialOrd for Voicing
impl PartialOrd for Voicing
impl Copy for Voicing
impl Eq for Voicing
impl StructuralPartialEq for Voicing
Auto Trait Implementations§
impl Freeze for Voicing
impl RefUnwindSafe for Voicing
impl Send for Voicing
impl Sync for Voicing
impl Unpin for Voicing
impl UnwindSafe for Voicing
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more