Expand description
Pitch-class set representations and operations for the SIM music libraries.
This crate models unordered collections of pitches as compact bitmasks. A
PitchClassMask packs the twelve pitch classes into a u16, supporting
rotation (transposition), inversion, prime-form normalization, and the
IntervalVector census used by set theory. PitchRangeMask does the same
across the full 128-key MIDI range. BitChord pairs a mask with an optional
root, and ThirdStackSignature encodes chords as stacks of minor and major
thirds.
Structs§
- BitChord
- A chord represented as a
PitchClassMaskwith an optional designated root. - Interval
Vector - An interval-class vector: counts of each of the six interval classes (1..=6) occurring among a set’s pitch classes.
- Pitch
Class Mask - A bitmask over the twelve pitch classes, with bit
nset when pitch classnis present. - Pitch
Range Mask - A bitmask over the 128 MIDI keys, with bit
nset when MIDI keynis present. - Third
Stack Signature - A chord described as a root pitch class plus an ordered stack of third
ThirdSteps.
Enums§
- Pitch
SetError - Error returned when a pitch-set value cannot be constructed, encoded, or decoded.
- Third
Step - A single step in a stack of thirds: a minor third (3 semitones) or major third (4 semitones).
Statics§
- RECIPES
- Cookbook recipes for this lib, embedded at build time.