Skip to main content

VoiceLeadingQuartet

Struct VoiceLeadingQuartet 

Source
pub struct VoiceLeadingQuartet { /* private fields */ }
Expand description

Two consecutive notes in each of two voices. Voice one is the upper voice.

Implementations§

Source§

impl VoiceLeadingQuartet

Source

pub fn new(v1n1: Pitch, v1n2: Pitch, v2n1: Pitch, v2n2: Pitch) -> Result<Self>

Builds a quartet from the first and second pitch of the upper voice, then the first and second pitch of the lower voice.

Source

pub fn from_names( v1n1: &str, v1n2: &str, v2n1: &str, v2n2: &str, ) -> Result<Self>

Builds a quartet from pitch names, in the same order as Self::new.

Source

pub fn with_key(self, key: Key) -> Self

Attaches the key the progression is heard in, which Self::is_proper_resolution and Self::clausula_vera consult.

Source

pub fn key(&self) -> Option<&Key>

The key the progression is heard in, if one was given.

Source

pub fn set_key(&mut self, key: Option<Key>)

Attaches a key, or takes one away.

Source

pub fn is_proper_resolution(&self) -> Result<bool>

Whether a dissonant first interval resolves the way voice-leading rules expect: music21’s isProperResolution. A fourth wants the upper voice to fall or stay; a tritone or a minor seventh wants the leading tone up, the seventh down and the right contrary motion — and with a key set, only when the notes really are those scale degrees. Anything else, and no motion at all, is proper.

Source

pub fn leap_not_set_with_step(&self) -> bool

Whether one voice leaps while the other neither steps nor holds: music21’s leapNotSetWithStep. Two thirds in contrary motion are let through.

Source

pub fn modal_opening(&self) -> Result<bool>

Whether the two voices open the way sixteenth-century counterpoint opens: music21’s modalOpening. Errors without a key.

One of the two harmonic intervals must be a unison or a fifth — the second may be, to allow for an anacrusis — and the pair must establish the tonic or the dominant. Which of the two says so is whichever can be read at all: music21 asks the first, and only falls to the second when the first says nothing.

Source

pub fn opens_incorrectly(&self) -> Result<bool>

The opposite of Self::modal_opening: music21’s opensIncorrectly.

Source

pub fn closes_incorrectly(&self) -> Result<bool>

The opposite of Self::clausula_vera: music21’s closesIncorrectly.

Source

pub fn clausula_vera(&self) -> Result<bool>

Whether the two voices close a clausula vera: stepwise contrary motion, one voice by a semitone and the other by a tone, onto a unison or octave on the tonic. Errors without a key.

Source

pub fn v1n1(&self) -> &Pitch

The upper voice’s first pitch.

Source

pub fn v1n2(&self) -> &Pitch

The upper voice’s second pitch.

Source

pub fn v2n1(&self) -> &Pitch

The lower voice’s first pitch.

Source

pub fn v2n2(&self) -> &Pitch

The lower voice’s second pitch.

Source

pub fn vertical_intervals(&self) -> &[Interval; 2]

The harmonic intervals from the upper voice to the lower voice, at the first and second moment.

Source

pub fn horizontal_intervals(&self) -> &[Interval; 2]

The melodic intervals each voice moves through, upper voice first.

Source

pub fn motion_type(&self, allow_anti_parallel: bool) -> MotionType

Classifies the motion. Anti-parallel motion is reported as contrary unless allow_anti_parallel is set.

Source

pub fn no_motion(&self) -> bool

Returns whether neither voice moves.

Source

pub fn oblique_motion(&self) -> bool

Returns whether exactly one voice holds its pitch.

Source

pub fn similar_motion(&self) -> bool

Returns whether both voices move in the same direction.

Source

pub fn parallel_motion( &self, required: Option<&ParallelRequirement>, allow_octave_displacement: bool, ) -> bool

Returns whether the voices move in the same direction keeping the same generic interval. With required, the interval must also be that one; allow_octave_displacement accepts a fifth answered by a twelfth.

Source

pub fn contrary_motion(&self) -> bool

Returns whether the voices move in opposite directions.

Source

pub fn outward_contrary_motion(&self) -> bool

Returns whether the voices move apart.

Source

pub fn inward_contrary_motion(&self) -> bool

Returns whether the voices move towards each other.

Source

pub fn anti_parallel_motion(&self, required: Option<&Interval>) -> bool

Returns whether contrary motion lands on the same simple interval it left, such as a fifth opening out to a twelfth. With required, that interval must also be the given one.

Source

pub fn parallel_interval(&self, interval: &Interval) -> bool

Returns whether the voices move in parallel or anti-parallel through the given interval, in any octave.

Source

pub fn parallel_fifth(&self) -> bool

Returns whether the voices move in parallel fifths.

Source

pub fn parallel_octave(&self) -> bool

Returns whether the voices move in parallel octaves.

Source

pub fn parallel_unison(&self) -> bool

Returns whether the voices move in parallel unisons.

Source

pub fn parallel_unison_or_octave(&self) -> bool

Returns whether the voices move in parallel unisons or octaves.

Source

pub fn hidden_interval(&self, interval: &Interval) -> bool

Returns whether similar motion arrives at the given interval without having started from it.

Source

pub fn hidden_fifth(&self) -> bool

Returns whether similar motion arrives at a perfect fifth.

Source

pub fn hidden_octave(&self) -> bool

Returns whether similar motion arrives at a perfect octave.

Source

pub fn voice_overlap(&self) -> bool

Returns whether a voice moves past where the other voice just was.

Source

pub fn voice_crossing(&self) -> bool

Returns whether the lower voice is above the upper voice at either moment.

Trait Implementations§

Source§

impl Clone for VoiceLeadingQuartet

Source§

fn clone(&self) -> VoiceLeadingQuartet

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 Debug for VoiceLeadingQuartet

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VoiceLeadingQuartet

Available on crate feature serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VoiceLeadingQuartet

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.