pub struct RuleSet {
pub id: String,
pub species: Species,
pub intervals: IntervalRules,
pub motion: MotionRules,
pub voices: VoiceRules,
pub durations: DurationRules,
pub dissonance: DissonanceRules,
}Expand description
Complete inspectable counterpoint rule set.
Fields§
§id: StringStable rule-set identifier.
species: SpeciesSpecies label.
intervals: IntervalRulesMelodic and harmonic interval data.
motion: MotionRulesRelative-motion data.
voices: VoiceRulesRange, crossing, and overlap data.
durations: DurationRulesExact duration data.
dissonance: DissonanceRulesDissonance preparation and resolution data.
Implementations§
Source§impl RuleSet
impl RuleSet
Sourcepub fn species_one(pulse: Ratio<i64>) -> RuleSet
pub fn species_one(pulse: Ratio<i64>) -> RuleSet
First-species rules with whole-pulse durations.
Sourcepub fn species_two(pulse: Ratio<i64>) -> RuleSet
pub fn species_two(pulse: Ratio<i64>) -> RuleSet
Second-species rules with weak-beat passing and neighbor tones.
Sourcepub fn species_three(pulse: Ratio<i64>) -> RuleSet
pub fn species_three(pulse: Ratio<i64>) -> RuleSet
Third-species rules with quarter-pulse motion.
Sourcepub fn species_four(pulse: Ratio<i64>) -> RuleSet
pub fn species_four(pulse: Ratio<i64>) -> RuleSet
Fourth-species rules allowing prepared suspensions.
Sourcepub fn open() -> RuleSet
pub fn open() -> RuleSet
Open rule set that accepts all pitch classes, durations, crossings, and motion.
Sourcepub fn validate(&self) -> Result<(), RuleError>
pub fn validate(&self) -> Result<(), RuleError>
Checks caller-authored rule data before analysis.
Sourcepub fn range_for_voice(&self, index: usize) -> PitchRange
pub fn range_for_voice(&self, index: usize) -> PitchRange
Effective pitch range for one source voice.
Trait Implementations§
impl Eq for RuleSet
impl StructuralPartialEq for RuleSet
Auto Trait Implementations§
impl Freeze for RuleSet
impl RefUnwindSafe for RuleSet
impl Send for RuleSet
impl Sync for RuleSet
impl Unpin for RuleSet
impl UnsafeUnpin for RuleSet
impl UnwindSafe for RuleSet
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
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 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> ⓘ
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