Skip to main content

sim_lib_pitch_core/
lib.rs

1//! Core pitch theory primitives for the SIM music libraries.
2//!
3//! This crate defines the foundational pitch types shared across the `sim-lib-pitch-*`
4//! constellation: the mod-12 [`PitchClass`], the octave-aware [`Pitch`], the
5//! letter-plus-accidental [`SpelledPitch`], and the [`Interval`] measured in
6//! semitones. Higher-level crates (sets, scales, chords, namers) build on these
7//! primitives rather than redefining their own pitch representations.
8//!
9//! Pitch classes use the twelve-tone equal-tempered convention where `C = 0` and
10//! values increase by semitone up to `B = 11`. Octave-aware pitches use the MIDI
11//! convention in which middle C (`C4`) is MIDI note 60.
12
13#![forbid(unsafe_code)]
14#![deny(missing_docs)]
15
16mod model;
17
18pub use model::*;
19
20/// Cookbook recipes for this lib, embedded at build time.
21pub static RECIPES: sim_cookbook::EmbeddedDir =
22    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
23
24#[cfg(test)]
25mod tests;