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) -> ToneRow
pub fn rotate(&self, steps: usize) -> ToneRow
Returns the row rotated left by steps, reduced modulo twelve.
Sourcepub fn permute_ordinals(
&self,
permutation: &OrdinalMap,
) -> Result<ToneRow, RowError>
pub fn permute_ordinals( &self, permutation: &OrdinalMap, ) -> Result<ToneRow, 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<ToneRow, RowError>
pub fn try_from_classes(classes: [PitchClass; 12]) -> Result<ToneRow, 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.
Trait Implementations§
impl Eq for ToneRow
impl StructuralPartialEq for ToneRow
Auto Trait Implementations§
impl Freeze for ToneRow
impl RefUnwindSafe for ToneRow
impl Send for ToneRow
impl Sync for ToneRow
impl Unpin for ToneRow
impl UnsafeUnpin for ToneRow
impl UnwindSafe for ToneRow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more