pub trait HasEnharmonicDistance {
    fn enharmonic_distance(&self) -> i8;
}
Expand description

A trait for types that have an enharmonic distance.

Required Methods§

Returns the enharmonic distance of the type (most likely an interval).

Due to the nature of enharmonic intervals, the distance is always an integer, and it looks a bit funky. Basically, using the circle of fifths, the distance is the number of fifths between the two notes. For example, a perfect fifth is 1 fifth away, and a major second is always two fifths away (look at the implementation). This preserves enharmonic correctness.

Implementors§