pub struct ToneRow { /* private fields */ }Expand description
An ordered sequence of pitch classes.
Implementations§
Source§impl ToneRow
impl ToneRow
Sourcepub fn new(pitch_classes: impl IntoIterator<Item = IntegerType>) -> Self
pub fn new(pitch_classes: impl IntoIterator<Item = IntegerType>) -> Self
Builds a row from pitch-class integers, which are reduced modulo 12 the
way music21’s pcToToneRow does, so [-6, 19, 128] is [6, 7, 8].
Sourcepub fn from_pitches<'a>(pitches: impl IntoIterator<Item = &'a Pitch>) -> Self
pub fn from_pitches<'a>(pitches: impl IntoIterator<Item = &'a Pitch>) -> Self
Builds a row from the pitch classes of a sequence of pitches.
Sourcepub fn pitch_classes(&self) -> &[u8] ⓘ
pub fn pitch_classes(&self) -> &[u8] ⓘ
The pitch classes in order.
Sourcepub fn pitches(&self) -> Vec<Pitch>
pub fn pitches(&self) -> Vec<Pitch>
The row as octave-less pitches, spelled the way music21 spells a pitch
built from a pitch class (C#, E-, F#, G#, B-).
Sourcepub fn note_names(&self) -> Vec<String>
pub fn note_names(&self) -> Vec<String>
The note names of the row, music21’s noteNames.
Sourcepub fn is_twelve_tone_row(&self) -> bool
pub fn is_twelve_tone_row(&self) -> bool
Whether the row is a permutation of all twelve pitch classes.
Sourcepub fn make_twelve_tone_row(&self) -> Result<ToneRow>
pub fn make_twelve_tone_row(&self) -> Result<ToneRow>
The row as a twelve-tone row: music21’s makeTwelveToneRow. There is
one row type here, so this is the row itself, and a row that is not a
permutation of the twelve pitch classes is an error rather than a row
whose twelve-tone questions fail one by one.
Sourcepub fn is_same_row(&self, other: &ToneRow) -> bool
pub fn is_same_row(&self, other: &ToneRow) -> bool
Whether two rows have the same pitch classes in the same order.
Sourcepub fn intervals_as_string(&self) -> String
pub fn intervals_as_string(&self) -> String
The intervals between consecutive pitch classes as one character each,
with T for ten and E for eleven: music21’s getIntervalsAsString.
Sourcepub fn zero_centered_transformation(
&self,
transformation: Transformation,
index: IntegerType,
) -> ToneRow
pub fn zero_centered_transformation( &self, transformation: Transformation, index: IntegerType, ) -> ToneRow
Transforms the row in the zero-centered convention, where P(n) and
I(n) start on pitch class n and R(n) and RI(n) end on it.
Sourcepub fn original_centered_transformation(
&self,
transformation: Transformation,
index: IntegerType,
) -> ToneRow
pub fn original_centered_transformation( &self, transformation: Transformation, index: IntegerType, ) -> ToneRow
Transforms the row in the original-centered convention, where T(n)
transposes the row up n semitones and the other transformations act
in place before transposing by n.
Sourcepub fn transformation(
&self,
convention: TransformationConvention,
transformation: Transformation,
index: IntegerType,
) -> ToneRow
pub fn transformation( &self, convention: TransformationConvention, transformation: Transformation, index: IntegerType, ) -> ToneRow
Transforms the row under either convention.
Sourcepub fn find_zero_centered_transformations(
&self,
other: &ToneRow,
) -> Vec<IndexedTransformation> ⓘ
pub fn find_zero_centered_transformations( &self, other: &ToneRow, ) -> Vec<IndexedTransformation> ⓘ
The zero-centered transformations that take this row to other, in
music21’s order P, I, R, RI.
Sourcepub fn find_original_centered_transformations(
&self,
other: &ToneRow,
) -> Vec<IndexedTransformation> ⓘ
pub fn find_original_centered_transformations( &self, other: &ToneRow, ) -> Vec<IndexedTransformation> ⓘ
The original-centered transformations that take this row to other,
in music21’s order T, I, R, RI.
Sourcepub fn find_transformations(
&self,
convention: TransformationConvention,
other: &ToneRow,
) -> Vec<IndexedTransformation> ⓘ
pub fn find_transformations( &self, convention: TransformationConvention, other: &ToneRow, ) -> Vec<IndexedTransformation> ⓘ
The transformations that take this row to other under either
convention.
Sourcepub fn matrix(&self) -> TwelveToneMatrix
pub fn matrix(&self) -> TwelveToneMatrix
The row’s matrix: every transposition of the row, ordered so that the leading diagonal is zero and each column reads the inversion.
Sourcepub fn find_historical(&self) -> Vec<&'static HistoricalRow>
pub fn find_historical(&self) -> Vec<&'static HistoricalRow>
The historical rows identical to this one.
Sourcepub fn find_transformed_historical(
&self,
convention: TransformationConvention,
) -> Vec<(&'static HistoricalRow, Vec<IndexedTransformation>)>
pub fn find_transformed_historical( &self, convention: TransformationConvention, ) -> Vec<(&'static HistoricalRow, Vec<IndexedTransformation>)>
The historical rows of which this row is a transformation, each with the transformations taking the historical row to this one.
Sourcepub fn is_all_interval(&self) -> Result<bool>
pub fn is_all_interval(&self) -> Result<bool>
Whether every interval class from one to eleven occurs between consecutive members of the row.
Errors unless the row is a twelve-tone row.
Sourcepub fn link_classification(&self) -> Result<Option<LinkClassification>>
pub fn link_classification(&self) -> Result<Option<LinkClassification>>
The Link chord classification of the row, if it is one: an
all-interval row containing a voicing of the all-trichord hexachord
[0, 1, 2, 4, 7, 8], numbered as in John Link’s catalogue.
Errors unless the row is a twelve-tone row.
Sourcepub fn is_link_chord(&self) -> Result<bool>
pub fn is_link_chord(&self) -> Result<bool>
Whether the row is a Link chord. Errors unless it is a twelve-tone row.
Sourcepub fn are_combinatorial(
&self,
first: Transformation,
first_index: IntegerType,
second: Transformation,
second_index: IntegerType,
) -> Result<bool>
pub fn are_combinatorial( &self, first: Transformation, first_index: IntegerType, second: Transformation, second_index: IntegerType, ) -> Result<bool>
Whether two zero-centered transformations of the row are hexachordally combinatorial: their first hexachords together form the aggregate.
Errors unless the row is a twelve-tone row.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToneRow
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ToneRow
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ToneRow
Source§impl<'a> IntoIterator for &'a ToneRow
impl<'a> IntoIterator for &'a 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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