Skip to main content

sim_lib_pitch_set/
lib.rs

1//! Pitch-class set representations and operations for the SIM music libraries.
2//!
3//! This crate models unordered collections of pitches as compact bitmasks. A
4//! [`PitchClassMask`] packs the twelve pitch classes into a `u16`, supporting
5//! rotation (transposition), inversion, prime-form normalization, and the
6//! [`IntervalVector`] census used by set theory. [`PitchRangeMask`] does the same
7//! across the full 128-key MIDI range. [`BitChord`] pairs a mask with an optional
8//! root, and [`ThirdStackSignature`] encodes chords as stacks of minor and major
9//! thirds.
10
11#![forbid(unsafe_code)]
12#![deny(missing_docs)]
13
14mod model;
15
16pub use model::*;
17
18/// Cookbook recipes for this lib, embedded at build time.
19pub static RECIPES: sim_cookbook::EmbeddedDir =
20    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
21
22#[cfg(test)]
23mod tests;