Skip to main content

Rules

Struct Rules 

Source
pub struct Rules {
Show 19 fields pub forbid_incomplete_possibilities: bool, pub upper_parts_max_semitone_separation: Option<IntegerType>, pub forbid_voice_crossing: bool, pub forbid_parallel_fifths: bool, pub forbid_parallel_octaves: bool, pub forbid_hidden_fifths: bool, pub forbid_hidden_octaves: bool, pub forbid_voice_overlap: bool, pub part_movement_limits: Vec<(usize, IntegerType)>, pub resolve_dominant_seventh_properly: bool, pub resolve_diminished_seventh_properly: bool, pub resolve_augmented_sixth_properly: bool, pub doubled_root_in_dim7: bool, pub apply_single_possib_rules_to_resolution: bool, pub apply_consecutive_possib_rules_to_resolution: bool, pub restrict_doublings_in_italian_a6_resolution: bool, pub upper_parts_remain_same: bool, pub part_pitch_limits: Vec<(usize, Pitch)>, pub parts_to_check: Vec<usize>,
}
Expand description

The rules a realization keeps, each on or off: which voicings of one chord are acceptable, which moves from one chord to the next are, and how the chords that must resolve a particular way are resolved.

Every rule starts out as music21’s does.

Fields§

§forbid_incomplete_possibilities: bool

Refuse a voicing that leaves out a note of its chord.

§upper_parts_max_semitone_separation: Option<IntegerType>

How far apart, in semitones, the upper parts may lie; None lets them lie anywhere.

§forbid_voice_crossing: bool

Refuse a voicing where a part sings above a part over it.

§forbid_parallel_fifths: bool

Refuse parallel fifths.

§forbid_parallel_octaves: bool

Refuse parallel octaves.

§forbid_hidden_fifths: bool

Refuse hidden fifths between the outer parts.

§forbid_hidden_octaves: bool

Refuse hidden octaves between the outer parts.

§forbid_voice_overlap: bool

Refuse a part moving past where a neighbouring part was.

§part_movement_limits: Vec<(usize, IntegerType)>

How far each part named may move, in semitones: (part, semitones), counting the highest part as one.

§resolve_dominant_seventh_properly: bool

Resolve a dominant seventh as a dominant seventh resolves.

§resolve_diminished_seventh_properly: bool

Resolve a diminished seventh as a diminished seventh resolves.

§resolve_augmented_sixth_properly: bool

Resolve an augmented sixth as an augmented sixth resolves.

§doubled_root_in_dim7: bool

Resolve a diminished seventh to the tonic with its root doubled, rather than its third, where the inversions do not decide it.

§apply_single_possib_rules_to_resolution: bool

Hold a special resolution to the rules for single voicings too.

§apply_consecutive_possib_rules_to_resolution: bool

Hold a special resolution to the rules for moving between voicings too.

§restrict_doublings_in_italian_a6_resolution: bool

In resolving an Italian sixth, let the root resolve only once and the third not be doubled.

§upper_parts_remain_same: bool

Keep every part but the bass where it was: music21’s _upperPartsRemainSame, which a realizer sets for a bass note that only moves.

§part_pitch_limits: Vec<(usize, Pitch)>

Hold each part named to a pitch: (part, pitch), counting the highest part as one. music21’s _partPitchLimits.

§parts_to_check: Vec<usize>

The parts that must keep their pitch from one voicing to the next: music21’s _partsToCheck.

Trait Implementations§

Source§

impl Clone for Rules

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

Source§

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

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

impl Default for Rules

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Rules

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 PartialEq for Rules

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Rules

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

impl StructuralPartialEq for Rules

Auto Trait Implementations§

§

impl Freeze for Rules

§

impl RefUnwindSafe for Rules

§

impl Send for Rules

§

impl Sync for Rules

§

impl Unpin for Rules

§

impl UnsafeUnpin for Rules

§

impl UnwindSafe for Rules

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.