chordcalc 0.1.0

Chord related utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Debug, Copy, Clone)]
pub enum Mode {
    Second,
    Fourth,
    Jazz,
}

impl crate::Mode for Mode {
    fn make_chord(&self, tonality: crate::MusicalNote) -> crate::Chord {
        let root = tonality;
        match self {
            Mode::Second => [root, root + 2, root + 7].into(),
            Mode::Fourth => [root, root + 5, root + 7].into(),
            Mode::Jazz => [root, root + 5, root + 7, root + 10, root + 14].into(),
        }
    }
}