Feat: WIP terse code documentation

This commit is contained in:
2026-02-26 01:08:16 +01:00
parent 71bd09d5ea
commit e1cf57918e
47 changed files with 499 additions and 24 deletions

View File

@@ -1,8 +1,12 @@
//! Chord definitions as semitone interval arrays.
/// Named chord with its interval pattern.
pub struct Chord {
pub name: &'static str,
pub intervals: &'static [i64],
}
/// All built-in chord types.
pub static CHORDS: &[Chord] = &[
// Triads
Chord {
@@ -169,6 +173,7 @@ pub static CHORDS: &[Chord] = &[
},
];
/// Find a chord's intervals by name.
pub fn lookup(name: &str) -> Option<&'static [i64]> {
CHORDS.iter().find(|c| c.name == name).map(|c| c.intervals)
}