Crates.io | persichetti |
lib.rs | persichetti |
version | 0.2.0 |
source | src |
created_at | 2021-04-04 00:48:10.487706 |
updated_at | 2021-05-09 19:28:41.85686 |
description | Foundational elements of western classical harmony, and tools to analyze them |
homepage | |
repository | https://github.com/kyle-silver/persichetti |
max_upload_size | |
id | 378567 |
size | 56,359 |
Persichetti is a crate that provides primitives for reasoning about harmonic concepts in western classical and contemporary music. It is named after Vincent Persichetti, composer and author of 20th Century Harmony. Some of the concepts in that book are realized here.
Name an interval, given the two notes that make it up
let b_flat = note!("Bb")?;
let g_sharp = note!("G#")?;
assert_eq!(Interval::new(Sixth, Augmented(1))?, Interval::from_notes(&b_flat, &g_sharp));
Add intervals together
let major_second = Interval::new(Second, Major)?;
let perfect_fourth = Interval::from_str("p4")?;
assert_eq!(Interval::new(Fifth, Perfect)?, major_second + perfect_fourth);
Combine notes and intervals
let f_sharp = note!("f#")?;
let major_third = ivl!("M3")?;
assert_eq!(note!("a#")?, f_sharp + major_third);
Other tools include:
Work-in-progress tools include: