Skip to main content

Crate sim_lib_pitch_set

Crate sim_lib_pitch_set 

Source
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 PitchClassMask with an optional designated root.
IntervalVector
An interval-class vector: counts of each of the six interval classes (1..=6) occurring among a set’s pitch classes.
PitchClassMask
A bitmask over the twelve pitch classes, with bit n set when pitch class n is present.
PitchRangeMask
A bitmask over the 128 MIDI keys, with bit n set when MIDI key n is present.
ThirdStackSignature
A chord described as a root pitch class plus an ordered stack of third ThirdSteps.

Enums§

PitchSetError
Error returned when a pitch-set value cannot be constructed, encoded, or decoded.
ThirdStep
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.