Expand description
A chord such as C, Cm and so on.
Fields
root: Note
chord_type: ChordType
notes: Vec<Note>
Implementations
sourceimpl Chord
impl Chord
pub fn new(root: Note, chord_type: ChordType) -> Self
sourcepub fn played_notes(&self) -> impl Iterator<Item = Note> + '_
pub fn played_notes(&self) -> impl Iterator<Item = Note> + '_
Return an iterator over the chord’s notes that are played on our instrument.
If the chord contains more notes than we have strings on our instrument, only required notes are played.
pub fn voicings(
&self,
config: VoicingConfig
) -> impl Iterator<Item = Voicing> + '_
pub fn transpose(&self, semitones: i8) -> Chord
Trait Implementations
sourceimpl Ord for Chord
impl Ord for Chord
sourceimpl PartialOrd<Chord> for Chord
impl PartialOrd<Chord> for Chord
sourcefn partial_cmp(&self, other: &Chord) -> Option<Ordering>
fn partial_cmp(&self, other: &Chord) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl TryFrom<&'_ [PitchClass]> for Chord
impl TryFrom<&'_ [PitchClass]> for Chord
impl Eq for Chord
impl StructuralEq for Chord
impl StructuralPartialEq for Chord
Auto Trait Implementations
impl RefUnwindSafe for Chord
impl Send for Chord
impl Sync for Chord
impl Unpin for Chord
impl UnwindSafe for Chord
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.