[][src]Struct musictheory::types::Matrix

pub struct Matrix;

The Pitch Matrix is a set of static Reference Tables containing Ordered Note Accidentals, Interval, and Degree based on PitchClass and PitchGroup.

Pitch Matrix

CnCsDnDsEnFnFsGnGsAnAsBn
CnCnDnEnFnGnAnBn
GnCnDnEnFsGnAnBn
DnCsDnEnFsGnAnBn
AnCsDnEnFsGsAnBn
EnCsDsEnFsGsAnBn
BnCsDsEnFsGsAsBn
FsCsDsFnFsGsAsBn
CsCnCsDsFnFsGsAs
GsCnCsDsFnGnGsAs
DsCnDnDsFnGnGsAs
AsCnDnDsFnGnAnAs
FnCnDnEnFnGnAnAs

Methods

impl Matrix[src]

pub fn interval(pc: &PitchClass, pg: &PitchGroup) -> Option<Interval>[src]

Get the Interval from Key Root for the provided position in the Interval table.

Interval Key Matrix

CnCsDnDsEnFnFsGnGsAnAsBn
CnP1M2M3P4P5M6M7
GnP4P5M6M7P1M2M3
DnM7P1M2M3P4P5M6
AnM3P4P5M6M7P1M2
EnM6M7P1M2M3P4P5
BnM2M3P4P5M6M7P1
FsP5M6M7P1M2M3P4
CsM7P1M2M3P4P5M6
GsM3P4P5M6M7P1M2
DsM6M7P1M2M3P4P5
AsM2M3P4P5M6M7P1
FnP5M6M7P1M2M3P4

pub fn degree(pc: &PitchClass, pg: &PitchGroup) -> Option<Degree>[src]

Get the Degree from Key Root for the provided position in the Degree table.

pub fn natural(pc: &PitchClass, pg: &PitchGroup) -> Option<Note>[src]

Get Note for the provided position in the Natural Key table.

Natural Key Matrix

CnCsDnDsEnFnFsGnGsAnAsBn
CnCDEFGAB
GnCDEF#GAB
DnC#DEF#GAB
AnC#DEF#G#AB
EnC#D#EF#G#AB
BnC#D#EF#G#A#B
FsC#D#E#F#G#A#B
CsCDbEbFGbAbBb
GsCDbEbFGAbBb
DsCDEbFGAbBb
AsCDEbFGABb
FnCDEFGABb

pub fn sharp(pc: &PitchClass, pg: &PitchGroup) -> Option<Note>[src]

Get Note for the provided position in the Sharp Key table.

Sharp Key Matrix

CnCsDnDsEnFnFsGnGsAnAsBn
CnCDEFGAB
GnCDEF#GAB
DnC#DEF#GAB
AnC#DEF#G#AB
EnC#D#EF#G#AB
BnC#D#EF#G#A#B
FsC#D#E#F#G#A#B
CsB#C#D#E#F#G#A#
GsB#C#D#E#F##G#A#
DsB#C##D#E#F##G#A#
AsB#C##D#E#F##G##A#
FnB#C##D##E#F##G##A#

pub fn flat(pc: &PitchClass, pg: &PitchGroup) -> Option<Note>[src]

Get Note for the provided position in the Flat Key table.

Flat Key Matrix

CnCsDnDsEnFnFsGnGsAnAsBn
CnCDEFGAB
GnDbbEbbFbGbAbbBbbCb
DnDbEbbFbGbAbbBbbCb
AnDbEbbFbGbAbBbbCb
EnDbEbFbGbAbBbbCb
BnDbEbFbGbAbBbCb
FsDbEbFGbAbBbCb
CsCDbEbFGbAbBb
GsCDbEbFGAbBb
DsCDEbFGAbBb
AsCDEbFGABb
FnCDEFGABb

Auto Trait Implementations

impl RefUnwindSafe for Matrix

impl Send for Matrix

impl Sync for Matrix

impl Unpin for Matrix

impl UnwindSafe for Matrix

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, 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.