Struct ukebox::voicing_graph::VoicingGraph
source · [−]pub struct VoicingGraph { /* private fields */ }
Expand description
A graph whose nodes represent chord voicings and whose edges are weighted by the distances between the voicings. It is used to find the (by some definition) optimal voice leading for a given sequence of chords.
Implementations
sourceimpl VoicingGraph
impl VoicingGraph
pub fn new(config: VoicingConfig) -> Self
pub fn add(&mut self, chord_seq: &ChordSequence)
sourcepub fn paths(
&self,
max_suggestions: usize
) -> impl Iterator<Item = (Vec<Voicing>, Distance)> + '_
pub fn paths(
&self,
max_suggestions: usize
) -> impl Iterator<Item = (Vec<Voicing>, Distance)> + '_
Return an iterator over the paths between the voicing nodes. The path with the lowest distance is presented first. If several paths have the same overall distance, they are further ranked by fingering distance.
Auto Trait Implementations
impl RefUnwindSafe for VoicingGraph
impl Send for VoicingGraph
impl Sync for VoicingGraph
impl Unpin for VoicingGraph
impl UnwindSafe for VoicingGraph
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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