Crate persichetti

Crate persichetti 

Source
Expand description

This crate provides basic functionality for working with and reasoning about the harmony common in western classical and contemporary music. Included are basic building blocks such as notes and intervals, and tools for identifying and generating more advanced structures.

§Example: Interval Naming

use persichetti::primitives::*;
let b_flat = Note::from_str("Bb")?;
let g_sharp = Note::from_str("G#")?;
assert_eq!(Interval::from_str("A6")?, Interval::from_notes(&b_flat, &g_sharp));

Modules§

primitives
This module provides notes and intervals for use in more complex applications, as well as macros for quickly initializing them.
serialism

Macros§

civl
Initialize a CompoundInterval
ivl
Initialize an Interval
note
Initialize a Note
pnote
Initialize a PitchedNote

Constants§

CHROMATIC_SCALE
The number of distinct pitches in a chromatic scale spanning one octave
C_ZERO_MIDI
In MIDI’s encoding scheme, this number represents the pitch corresponding to C0 in scientific pitch notation
DIATONIC_SCALE
The number of notes in a diatonic scale