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, numeric normalization, conventional
6//! normal-order and prime-form classification, complements, set inclusion,
7//! symmetry, Z-relation, interval/gap forms, graph neighborhoods, and the
8//! [`IntervalVector`] census used by set theory. [`analyze_set_relations`]
9//! reports exact Tn/TnI operators, canonical equivalence, inclusion,
10//! complements, and Z-relations without conflating conventional prime form with
11//! numeric normalization. [`PitchRangeMask`] does the same across the full 128-key
12//! MIDI range. [`BitChord`] pairs a mask with an optional root, and
13//! [`ThirdStackSignature`] encodes chords as stacks of minor and major thirds.
14
15#![forbid(unsafe_code)]
16#![deny(missing_docs)]
17
18mod conventional;
19mod geometry;
20mod model;
21mod relation;
22
23pub use conventional::*;
24pub use geometry::*;
25pub use model::*;
26pub use relation::*;
27
28/// Cookbook recipes for this lib, embedded at build time.
29pub static RECIPES: sim_cookbook::EmbeddedDir =
30 include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
31
32#[cfg(test)]
33mod tests;