Skip to main content

music_comp_mt/
lib.rs

1//! `Rust Music Theory` is a library that provides programmatic implementation of the basis of music theory.
2//!
3//! ## About
4//!
5//! `Rust Music Theory` is used to procedurally utilize music theory notions like Note, Chord, Scale,
6//! Interval, Key and more. All these theoretical concepts of sound and music are implemented as
7//! separate modules in the library. They sometimes can be used individually, and sometimes need
8//! to be used together to correctly reflect the music theory to the code.
9//!
10//! ## Quick Example
11//!
12//! ```no_run
13//! use music_comp_mt::note::{Note, Notes, Pitch, PitchSymbol::*};
14//! use music_comp_mt::scale::{Direction, Scale, ScaleType, Mode};
15//! use music_comp_mt::chord::{Chord, Number as ChordNumber, Quality as ChordQuality};
16//!
17//! // to create a Note, specify a pitch class and an octave;
18//! let note = Note::new(Pitch::from(As), 4);
19//!
20//! // Scale Example
21//! let scale = Scale::new(
22//!     ScaleType::Diatonic,
23//!     Pitch::from(C),
24//!     4,
25//!     Some(Mode::Ionian),
26//!     Direction::Ascending,
27//! ).unwrap();
28//!
29//! let scale_notes = scale.notes();
30//!
31//! // Chord Example
32//! let chord = Chord::new(Pitch::from(C), ChordQuality::Major, ChordNumber::Triad);
33//!
34//! let chord_notes = chord.notes();
35//! ```
36
37pub mod analysis;
38pub mod chord;
39pub mod counterpoint;
40pub mod figured_bass;
41pub mod harmony;
42pub mod interval;
43pub mod neo_riemannian;
44pub mod note;
45pub mod scale;
46pub mod set_class;
47pub mod voice_leading;