pub fn from_notes(lower: &Note, higher: &Note) -> Interval {
        let size = NoteName::interval_size(&lower.name, &higher.name);
        // white key distance
        let wk_distance = higher.name.chromatic_scale_degree() as isize - lower.name.chromatic_scale_degree() as isize;
        let wk_distance = wk_distance.rem_euclid(CHROMATIC_SCALE as isize) as isize;
        let chromatic_delta = -lower.accidental.chromatic_offset() + wk_distance + higher.accidental.chromatic_offset();
        dbg!(chromatic_delta);
        let quality = IntervalQuality::from_chromatic_span(&size, chromatic_delta);
        Interval { size, quality }
    }
/// Given two [`Note`]s, calculate the interval that describes their relationship. While there is discourse around
/// the existence of a [diminished unison](https://www.youtube.com/watch?v=y5DxegJ5Hmw), this library acknowledges
/// its existence since there is no concept of an octave.
/// ```rust
/// # use persichetti::{ivl, note};
/// # use persichetti::primitives::*;
/// # fn main() -> Result<(), Error> {
/// assert_eq!(ivl!("A6")?, Interval::from_notes(&note!("Bb")?, &note!("G#")?));
/// assert_eq!(ivl!("dU")?, Interval::from_notes(&note!("F#")?, &note!("F")?));
/// # Ok(())
/// # }
/// ```
Given two [`Note`]s, calculate the interval that describes their relationship. While there is discourse around
the existence of a [diminished unison], this library acknowledges
its existence since there is no concept of an octave.
Given two [ ` Note ` ] s calculate the interval that describes their relationship . While there is discourse around the existence of a [ diminished unison ] this library acknowledges its existence since there is no concept of an octave .
pub fn from_notes(lower: &Note, higher: &Note) -> Interval {
        let size = NoteName::interval_size(&lower.name, &higher.name);
        // white key distance
        let wk_distance = higher.name.chromatic_scale_degree() as isize - lower.name.chromatic_scale_degree() as isize;
        let wk_distance = wk_distance.rem_euclid(CHROMATIC_SCALE as isize) as isize;
        let chromatic_delta = -lower.accidental.chromatic_offset() + wk_distance + higher.accidental.chromatic_offset();
        dbg!(chromatic_delta);
        let quality = IntervalQuality::from_chromatic_span(&size, chromatic_delta);
        Interval { size, quality }
    }
pub fn from_notes ( lower : & Note , higher : & Note ) -> Interval { let size = NoteName :: interval_size ( & lower . name , & higher . name ) ; // white key distance let wk_distance = higher . name . chromatic_scale_degree ( ) as isize - lower . name . chromatic_scale_degree ( ) as isize ; let wk_distance = wk_distance . rem_euclid ( CHROMATIC_SCALE as isize ) as isize ; let chromatic_delta = - lower . accidental . chromatic_offset ( ) + wk_distance + higher . accidental . chromatic_offset ( ) ; dbg ! ( chromatic_delta ) ; let quality = IntervalQuality :: from_chromatic_span ( & size , chromatic_delta ) ; Interval { size , quality } }
Given two [`Note`]s, calculate the interval that describes their relationship.
Given two [ ` Note ` ] s calculate the interval that describes their relationship .
lower
&Note
higher
&Note
use persichetti::{ivl, note};
None
use persichetti::primitives::*;
None
fn main() -> result<(), error> {
None
ok(())
None
}
None