pub struct Chord {
    pub notes: Vec<Note>,
}
Expand description

A Chord contains a vector of Notes

Fields

notes: Vec<Note>

Implementations

Creates a new Chord from a vector of Note.

Examples

Basic usage:

use mumuse::music::chord::Chord;
use mumuse::music::note::Note;
let n = Note::try_from("A3").unwrap();
let t = Chord::new(vec![n, n]);

Invert a chord in natural order.

Inversion wrap around the length of the chord.

Examples

Basic usage:

use mumuse::music::note::Note;
let n = Note::try_from("A3").unwrap();
let c = n.chord("maj").invert(2);

Trait Implementations

Overload operator + for Chord + Interval

Examples

Basic usage:

use mumuse::music::note::Note;
use mumuse::music::common::Interval;
let n = Note::try_from("A3").unwrap();
let c = n.chord("maj");
let c_ = c + Interval::MinorSecond;

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Overload operator - for Chord - Interval

Examples

Basic usage:

use mumuse::music::note::Note;
use mumuse::music::common::Interval;
let n = Note::try_from("A3").unwrap();
let c = n.chord("maj");
let c_ = c - Interval::MinorSecond;

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.