1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! `Rust Music Theory` is a library that provides programmatic implementation of the basis of music theory.
//!
//! ## About
//!
//! `Rust Music Theory` is used to procedurally utilize music theory notions like Note, Chord, Scale,
//! Interval, Key and more. All these theoretical concepts of sound and music are implemented as
//! Separate modules in the library. They sometimes can be used individually, and sometimes need
//! to be used together to correctly reflect the music theory to the code.
//!
//! ## Quick Example
//!
//! The following examples are the simplest usage of the library.
//! Please see the tests folder for detailed examples of the modules.
//!
//! ```no_run
//! extern crate rust_music_theory as rustmt;
//! use rustmt::note::{Note, Notes, PitchClass};
//! use rustmt::scale::{Direction, Scale, ScaleType, Mode};
//! use rustmt::chord::{Chord, Number as ChordNumber, Quality as ChordQuality};
//!
//! // to create a Note, specify a pitch class and an octave;
//! let note = Note::new(PitchClass::As, 4);
//! // Note { pitch_class: A, octave: 4 }
//!
//! // Scale Example;
//! let scale = Scale::new(
//!     ScaleType::Diatonic,    // scale type
//!     PitchClass::C,          // tonic
//!     4,                      // octave
//!     Some(Mode::Ionian),     // scale mode
//!     Direction::Ascending,   // direction
//! ).unwrap();
//!
//! // returns a Vector of the Notes of the scale
//! let scale_notes = scale.notes();
//!
//! // Chord Example;
//! let chord = Chord::new(PitchClass::C, ChordQuality::Major, ChordNumber::Triad);
//!
//! // returns a Vector of the Notes of the chord
//! let chord_notes = chord.notes();

extern crate strum;
pub mod chord;
pub mod interval;
pub mod note;
pub mod scale;