Tonality
A library for handling tonal pitch classes, keys, accidentals and alterations.
Example
You can find the tonal pitch classes of the notes in a chord by specifying the chord as a collection of (scale degree, alteration) pairs.
use ;
type Chord = ;
// The seventh in a dominant seventh chord is altered one semitone flat relative
// to the major scale
let dom7: Chord = vec!;
let root = Fs;
let chord_tones: = dom7
.iter
.filter_map
.collect;
let expected = vec!;
assert_eq!;
Inspiration
Types and operations, in particular the Tpc type, are influenced by Musescore's internal library.
Related crates
pitch_calc lets you convert between
a number of different pitch representations, including the frequency domain.
rust-music-theory supports
procedurally utilizing music theory notions like Note, Chord, Scale, Interval
and more.
This crate might support conversion to and from types in the above mentioned crates in the future.