pub struct Chord {
pub degrees: Vec<i32>,
pub octave: i32,
pub name: String,
}Expand description
A set of simultaneously played scale degrees.
Fields§
§degrees: Vec<i32>§octave: i32§name: StringImplementations§
Source§impl Chord
impl Chord
pub fn new(degrees: Vec<i32>, octave: i32, name: impl Into<String>) -> Self
pub fn triad_major(octave: i32) -> Self
pub fn triad_minor(octave: i32) -> Self
pub fn seventh(octave: i32) -> Self
pub fn sus2(octave: i32) -> Self
pub fn sus4(octave: i32) -> Self
pub fn power(octave: i32) -> Self
pub fn diminished(octave: i32) -> Self
pub fn augmented(octave: i32) -> Self
pub fn add9(octave: i32) -> Self
Sourcepub fn frequencies(&self, scale: &Scale) -> Vec<f32>
pub fn frequencies(&self, scale: &Scale) -> Vec<f32>
Frequencies of all notes given a scale.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chord
impl RefUnwindSafe for Chord
impl Send for Chord
impl Sync for Chord
impl Unpin for Chord
impl UnsafeUnpin 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.