chordcalc 0.1.0

Chord related utilities
Documentation
#[derive(Debug, Copy, Clone)]
pub enum Mode {
    DominantNinth,
    DominantEleventh,
    DominantThirteenth,
}

impl crate::Mode for Mode {
    fn make_chord(&self, tonality: crate::MusicalNote) -> crate::Chord {
        let root = tonality;
        match self {
            Mode::DominantNinth => [root, root + 4, root + 7, root + 10, root + 14].into(),
            Mode::DominantEleventh => {
                [root, root + 4, root + 7, root + 10, root + 14, root + 17].into()
            }
            Mode::DominantThirteenth => [
                root,
                root + 4,
                root + 7,
                root + 10,
                root + 14,
                root + 17,
                root + 21,
            ]
            .into(),
        }
    }
}