Trait klib::interval::HasEnharmonicDistance
source · pub trait HasEnharmonicDistance {
fn enharmonic_distance(&self) -> i8;
}Expand description
A trait for types that have an enharmonic distance.
Required Methods§
sourcefn enharmonic_distance(&self) -> i8
fn enharmonic_distance(&self) -> i8
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.