pub struct Segment {
pub rules: Rules,
/* private fields */
}Expand description
A bass note, its figures, and the voicings they allow.
Fields§
§rules: RulesThe rules its voicings are held to.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn new(
bass: Pitch,
quarter_length: FloatType,
notation: &Notation,
scale: &FiguredBassScale,
rules: Rules,
num_parts: usize,
max_pitch: Pitch,
) -> Result<Self>
pub fn new( bass: Pitch, quarter_length: FloatType, notation: &Notation, scale: &FiguredBassScale, rules: Rules, num_parts: usize, max_pitch: Pitch, ) -> Result<Self>
The segment of bass under notation, read in scale, voiced in
num_parts parts no higher than max_pitch: music21’s Segment.
§Errors
A bass or figures the scale cannot read, or a maximum pitch with no octave.
Sourcepub fn from_pitch_names(
bass: Pitch,
quarter_length: FloatType,
pitch_names: Vec<String>,
rules: Rules,
num_parts: usize,
max_pitch: Pitch,
) -> Result<Self>
pub fn from_pitch_names( bass: Pitch, quarter_length: FloatType, pitch_names: Vec<String>, rules: Rules, num_parts: usize, max_pitch: Pitch, ) -> Result<Self>
The segment of bass spelling the notes named pitch_names, as
music21 builds one given listOfPitches rather than figures.
§Errors
A pitch name that is none, or a maximum pitch with no octave.
Sourcepub fn overlaid(self) -> Self
pub fn overlaid(self) -> Self
The same segment, with the parts its rules hold to a pitch sung at
that pitch in every voicing: music21’s OverlaidSegment.
Sourcepub fn quarter_length(&self) -> FloatType
pub fn quarter_length(&self) -> FloatType
How long the bass lasts, in quarter notes.
Sourcepub fn pitch_names(&self) -> &[String]
pub fn pitch_names(&self) -> &[String]
The names of the notes the bass and figures stand for, the bass’s
first: music21’s pitchNamesInChord.
Sourcepub fn pitches_above_bass(&self) -> &[Pitch]
pub fn pitches_above_bass(&self) -> &[Pitch]
Every pitch from the bass up to the highest allowed that spells one
of those notes, lowest first: music21’s allPitchesAboveBass.
Sourcepub fn all_single_possibilities(&self) -> Result<Vec<Possibility>>
pub fn all_single_possibilities(&self) -> Result<Vec<Possibility>>
Every voicing, acceptable or not, in music21’s order: the highest
part changes slowest. music21’s allSinglePossibilities.
Sourcepub fn all_correct_single_possibilities(&self) -> Result<Vec<Possibility>>
pub fn all_correct_single_possibilities(&self) -> Result<Vec<Possibility>>
The voicings its rules accept: music21’s
allCorrectSinglePossibilities.
The voicings are walked as indices into what each part may sing, and held to the rules over each pitch’s place and name worked out once, so only the voicings kept are ever built: a seventh chord has thousands to look at and a handful to keep.
Sourcepub fn all_correct_consecutive_possibilities(
&self,
next: &mut Segment,
) -> Result<Consecutive>
pub fn all_correct_consecutive_possibilities( &self, next: &mut Segment, ) -> Result<Consecutive>
Every pair of voicings next may follow this segment by, resolving
this chord by its own rule where the rules say to and it is a chord
with one: music21’s allCorrectConsecutivePossibilities.
next is taken mutably because music21 lets a dominant seventh
resolving to its tonic leave that tonic incomplete, which it does by
switching the tonic segment’s rule off.
§Errors
Two segments of different numbers of parts or different highest pitches, or a resolution that fails.
Sourcepub fn resolve_dominant_seventh_segment(
&self,
next: &mut Segment,
) -> Result<Consecutive>
pub fn resolve_dominant_seventh_segment( &self, next: &mut Segment, ) -> Result<Consecutive>
Resolves a dominant seventh to next: to the tonic, major or minor,
and from root position also to either submediant or subdominant.
music21’s resolveDominantSeventhSegment.
§Errors
A segment whose chord is no dominant seventh.
Sourcepub fn resolve_diminished_seventh_segment(
&self,
next: &Segment,
doubled_root: bool,
) -> Result<Consecutive>
pub fn resolve_diminished_seventh_segment( &self, next: &Segment, doubled_root: bool, ) -> Result<Consecutive>
Resolves a diminished seventh to next: to the tonic, major or minor,
or to the subdominant. With doubled_root, a resolution to the tonic
doubles its root, unless the inversions decide it.
music21’s resolveDiminishedSeventhSegment.
§Errors
A segment whose chord is no fully diminished seventh.
Sourcepub fn resolve_augmented_sixth_segment(
&self,
next: &Segment,
) -> Result<Consecutive>
pub fn resolve_augmented_sixth_segment( &self, next: &Segment, ) -> Result<Consecutive>
Resolves an augmented sixth to next: to the tonic in second
inversion, major or minor, or to the dominant. An Italian sixth, and
a kind music21 has no rule for, resolve as any chord does.
music21’s resolveAugmentedSixthSegment.
§Errors
A segment whose chord is no augmented sixth.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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,
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