Struct ukebox::voicing::Voicing [−][src]
pub struct Voicing { /* fields omitted */ }
Implementations
impl Voicing
[src]
impl Voicing
[src]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
[src]
pub fn uke_strings(&self) -> Iter<'_, UkeString>
[src]
pub fn roots(&self) -> impl Iterator<Item = Note> + '_
[src]
pub fn frets(&self) -> impl Iterator<Item = FretID> + '_
[src]
pub fn notes(&self) -> impl Iterator<Item = Note> + '_
[src]
pub fn count_pressed_strings(&self) -> usize
[src]
pub fn count_pressed_strings(&self) -> usize
[src]Return the overall number of strings pressed down when playing this voicing.
pub fn get_min_pressed_fret(&self) -> FretID
[src]
pub fn get_min_pressed_fret(&self) -> FretID
[src]Return the lowest fret at which a string is pressed down.
pub fn get_min_fret(&self) -> FretID
[src]
pub fn get_min_fret(&self) -> FretID
[src]Return the lowest fret involved in playing the chord voicing (is 0 if the chord is open).
pub fn get_max_fret(&self) -> FretID
[src]
pub fn get_span(&self) -> FretID
[src]
pub fn spells_out(&self, chord: &Chord) -> bool
[src]
pub fn spells_out(&self, chord: &Chord) -> bool
[src]Return true
if the voicing contains all the notes needed
to play the given chord
.
pub fn get_chords(&self) -> Vec<Chord>
[src]
pub fn has_barre(&self) -> bool
[src]
pub fn has_barre(&self) -> bool
[src]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
pub fn fingers_on_strings(&self) -> [u8; 4]
[src]
pub fn fingers_on_strings(&self) -> [u8; 4]
[src]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.
pub fn semitone_distance(&self, other: Voicing) -> u8
[src]
pub fn semitone_distance(&self, other: Voicing) -> u8
[src]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: Voicing) -> u8
[src]
pub fn distance(&self, other: Voicing) -> Distance
[src]
Trait Implementations
impl Default for Voicing
[src]
impl Default for Voicing
[src]The default implementation is used to easily create an “empty” start and end node in the voicing graph.
impl Ord for Voicing
[src]
impl Ord for Voicing
[src]impl PartialOrd<Voicing> for Voicing
[src]
impl PartialOrd<Voicing> for Voicing
[src]fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Voicing
[src]
impl Eq for Voicing
[src]
impl StructuralEq for Voicing
[src]
impl StructuralPartialEq for Voicing
[src]
Auto Trait Implementations
impl RefUnwindSafe for Voicing
impl Send for Voicing
impl Sync for Voicing
impl Unpin for Voicing
impl UnwindSafe for Voicing
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more