Crate persichetti[][src]

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 quicky initializing them.

serialism

Macros

ivl

Initialize an Interval from either the Interval::from_str constructor or the Interval::new constructor. In either case, the return type is a Result of Interval or IntervalError.

note

Initialize a Note from either the Note::from_str constructor or the Note::new constructor. In either case, the the return type is a Result of Note or NoteError.

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