Crate klib

source ·
Expand description

A library to easily explore music theory principles.

Examples

use klib::core::chord::*;
use klib::core::known_chord::KnownChord;
use klib::core::modifier::Degree;
use klib::core::note::*;

// Check to see what _kind_ of chord this is.
assert_eq!(
    Chord::new(C).augmented().seven().known_chord(),
    KnownChord::AugmentedDominant(Degree::Seven)
);
use klib::core::base::Parsable;
use klib::core::chord::*;
use klib::core::note::*;

// Parse a chord from a string, and inspect the scale.
assert_eq!(
    Chord::parse("Cm7b5").unwrap().scale(),
    vec![C, D, EFlat, F, GFlat, AFlat, BFlat]
);
use klib::core::chord::*;
use klib::core::note::*;

// From a note, create a chord, and look at the chord tones.
assert_eq!(
    C.into_chord().augmented().major7().chord(),
    vec![C, E, GSharp, B]
);

Re-exports

Modules

  • Analysis types and functions for the kord crate.
  • Core types and functions for the kord crate.
  • Helper functions for the project.
  • The ml module contains the core ml logic for gathering, training, and inference.