pub struct Chord {
pub root: Note,
pub chord_type: ChordType,
pub notes: Vec<Note>,
}
Expand description
A chord such as C, Cm and so on.
Fields§
§root: Note
§chord_type: ChordType
§notes: Vec<Note>
Implementations§
source§impl 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) -> Self
Trait Implementations§
source§impl Ord for Chord
impl Ord for Chord
source§impl PartialEq for Chord
impl PartialEq for Chord
source§impl PartialOrd for Chord
impl PartialOrd for Chord
1.0.0 · source§fn 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 moresource§impl TryFrom<&[PitchClass]> for Chord
impl TryFrom<&[PitchClass]> for Chord
source§fn try_from(pitches: &[PitchClass]) -> Result<Self, Self::Error>
fn try_from(pitches: &[PitchClass]) -> Result<Self, Self::Error>
Determine the chord that is represented by a list of pitch classes.
§type Error = NoMatchingChordTypeFoundError
type Error = NoMatchingChordTypeFoundError
The type returned in the event of a conversion error.
impl Eq for Chord
impl StructuralPartialEq for Chord
Auto Trait Implementations§
impl Freeze for Chord
impl RefUnwindSafe for Chord
impl Send for Chord
impl Sync for Chord
impl Unpin for Chord
impl UnwindSafe for Chord
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
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
Compare self to
key
and return true
if they are equal.