[][src]Struct minstrel::Key

pub struct Key { /* fields omitted */ }

A collection of seven notes, categorised by a Mode.

Implementations

impl Key[src]

pub fn new(root_note: Note, mode: Mode) -> Self[src]

Creates a new Key based on the given root_note and mode.

Examples

use minstrel::{Key, Mode, Note};

let c_major = Key::new(Note::new(0), Mode::Ionian);
let a_minor = Key::new(Note::new(9), Mode::Aeolian);

pub fn notes_disregarding_octave(self) -> [Note; 7][src]

Returns the key's seven notes without regard for octave numbers.

See Note::disregard_octave() for more detail.

Examples

use minstrel::{Key, Mode, Note};

let e_phrygian = Key::new(Note::new(4), Mode::Phrygian);
assert_eq!(
    e_phrygian.notes_disregarding_octave(),
    [
        Note::new(4),
        Note::new(5),
        Note::new(7),
        Note::new(9),
        Note::new(11),
        Note::new(0),
        Note::new(2),
    ]
);

Trait Implementations

impl Clone for Key[src]

impl Copy for Key[src]

impl Debug for Key[src]

impl Display for Key[src]

Auto Trait Implementations

impl RefUnwindSafe for Key

impl Send for Key

impl Sync for Key

impl Unpin for Key

impl UnwindSafe for Key

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.