pub struct ToneRow { /* private fields */ }Expand description
An ordered aggregate containing every canonical pitch class exactly once.
Implementations§
Source§impl ToneRow
impl ToneRow
Sourcepub fn rotate(&self, steps: usize) -> Self
pub fn rotate(&self, steps: usize) -> Self
Returns the row rotated left by steps, reduced modulo twelve.
Sourcepub fn permute_ordinals(
&self,
permutation: &OrdinalMap,
) -> Result<Self, RowError>
pub fn permute_ordinals( &self, permutation: &OrdinalMap, ) -> Result<Self, RowError>
Applies a caller-supplied validated ordinal permutation to the row.
Source§impl ToneRow
impl ToneRow
Sourcepub fn try_from_classes(classes: [PitchClass; 12]) -> Result<Self, RowError>
pub fn try_from_classes(classes: [PitchClass; 12]) -> Result<Self, RowError>
Constructs a row after exact membership and multiplicity validation.
The fixed array establishes cardinality. Series with the exhaustive
exactly-once rule supplies the canonical alphabet membership and
multiplicity proof.
Sourcepub const fn classes(&self) -> &[PitchClass; 12]
pub const fn classes(&self) -> &[PitchClass; 12]
Returns the twelve classes in row order.
Sourcepub fn apply(&self, operation: RowOperation) -> RowForm
pub fn apply(&self, operation: RowOperation) -> RowForm
Applies a total P/I/R/RI operation and retains its normalized identity.
Source§impl ToneRow
impl ToneRow
Sourcepub fn segment(&self, start: usize, len: usize) -> Result<RowSegment, RowError>
pub fn segment(&self, start: usize, len: usize) -> Result<RowSegment, RowError>
Extracts a contiguous segment [start, start + len) from the row.
Sourcepub fn wrapped_segment(
&self,
start: usize,
len: usize,
) -> Result<RowSegment, RowError>
pub fn wrapped_segment( &self, start: usize, len: usize, ) -> Result<RowSegment, RowError>
Extracts a wrapping segment starting at start and continuing modulo twelve.
Sourcepub fn indexed_segment(
&self,
ordinals: &[usize],
) -> Result<RowSegment, RowError>
pub fn indexed_segment( &self, ordinals: &[usize], ) -> Result<RowSegment, RowError>
Extracts a segment from an explicit ordinal sequence.
Sourcepub fn ordered_intervals(&self) -> OrderedIntervalString
pub fn ordered_intervals(&self) -> OrderedIntervalString
Returns the directed ordered intervals between adjacent row positions.