Skip to main content

Verticality

Struct Verticality 

Source
pub struct Verticality<'t, 'a> { /* private fields */ }
Expand description

What starts, stops and sounds across one offset of a TimespanTree: music21’s Verticality.

Implementations§

Source§

impl<'t, 'a> Verticality<'t, 'a>

Source

pub fn offset(&self) -> FloatType

The offset.

Source

pub fn start_timespans(&self) -> &[&'t ElementTimespan<'a>]

The timespans starting here: music21’s startTimespans.

Source

pub fn overlap_timespans(&self) -> &[&'t ElementTimespan<'a>]

The timespans sounding across: music21’s overlapTimespans.

Source

pub fn stop_timespans(&self) -> &[&'t ElementTimespan<'a>]

The timespans ending here: music21’s stopTimespans.

Source

pub fn start_and_overlap_timespans(&self) -> Vec<&'t ElementTimespan<'a>>

Those starting, then those sounding across: music21’s startAndOverlapTimespans.

Source

pub fn pitch_set(&self) -> Vec<Pitch>

Each pitch sounding, each name and octave once, lowest first: music21’s pitchSet, ordered as its toChord orders it.

Source

pub fn pitch_class_set(&self) -> Vec<u8> ⓘ

Each pitch class sounding, once, in order: music21’s pitchClassSet, by its classes.

Source

pub fn to_chord(&self) -> Result<Chord>

A chord of the pitches sounding, lowest first: music21’s toChord.

§Errors

None in practice; a chord of no pitches is an empty chord.

Source

pub fn bass_timespan(&self) -> Option<&'t ElementTimespan<'a>>

The timespan sounding the lowest pitch, the last of those sounding it alike: music21’s bassTimespan.

Source

pub fn measure_number(&self) -> Option<IntegerType>

The measure of the first timespan starting here: music21’s measureNumber.

Source

pub fn paired_motion( &self, include_rests: bool, include_oblique: bool, ) -> Vec<(&'t ElementTimespan<'a>, &'t ElementTimespan<'a>)>

Each pitched timespan starting here paired with the one before it in its part, and, with include_oblique, each pitched one sounding across paired with itself: music21’s getPairedMotion. Without include_rests, a pair is kept only where the earlier one stops here; without include_oblique, a pair of the same pitches is not kept.

Source

pub fn voice_leading_timespans( &self, include_rests: bool, include_oblique: bool, include_no_motion: bool, part_pairs: Option<&[(usize, usize)]>, ) -> Result<Vec<[&'t ElementTimespan<'a>; 4]>>

Each two pairs of Self::paired_motion, the earlier pair first: music21’s getAllVoiceLeadingQuartets(returnObjects=False). Without include_no_motion, two pairs neither of which moves are left out; with part_pairs, only those whose two parts are one of the pairs of the source’s parts given, by their places among them.

§Errors

A part pair naming a part the source has not got.

Source

pub fn voice_leading_quartets( &self, include_rests: bool, include_oblique: bool, include_no_motion: bool, part_pairs: Option<&[(usize, usize)]>, ) -> Result<Vec<VoiceLeadingQuartet>>

The same quartets as voice-leading quartets, where all four are notes: music21’s getAllVoiceLeadingQuartets.

§Errors

As Self::voice_leading_timespans, or two pitches no interval can be spelled between.

Source

pub fn make_element( &self, length: Option<FloatType>, add_ties: bool, remove_redundant_pitches: bool, ) -> Result<StreamElement>

A chord of every pitch sounding here, lasting length or, without one, until the next start – a quarter where nothing follows – or a rest where nothing sounds: music21’s makeElement. With add_ties, a note begun before or going on after is tied; with remove_redundant_pitches, a pitch two timespans sound is one note.

§Errors

A length no duration can have, or a chord symbol whose pitches cannot be worked out.

Source

pub fn next_start_offset(&self) -> Option<FloatType>

The next offset a timespan starts at: music21’s nextStartOffset.

Source

pub fn next(&self) -> Option<Verticality<'t, 'a>>

The verticality there: music21’s nextVerticality.

Source

pub fn previous(&self) -> Option<Verticality<'t, 'a>>

The verticality at the last offset before this one a timespan starts at: music21’s previousVerticality.

Source

pub fn time_to_next_event(&self) -> Option<FloatType>

How long until the next start, or the end of the tree after the last: music21’s timeToNextEvent.

Trait Implementations§

Source§

impl<'t, 'a> Clone for Verticality<'t, 'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'t, 'a> Debug for Verticality<'t, 'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t, 'a> Freeze for Verticality<'t, 'a>

§

impl<'t, 'a> RefUnwindSafe for Verticality<'t, 'a>

§

impl<'t, 'a> Send for Verticality<'t, 'a>

§

impl<'t, 'a> Sync for Verticality<'t, 'a>

§

impl<'t, 'a> Unpin for Verticality<'t, 'a>

§

impl<'t, 'a> UnsafeUnpin for Verticality<'t, 'a>

§

impl<'t, 'a> UnwindSafe for Verticality<'t, 'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.