pub struct VoiceLeadingPolicy {
pub entrance_cost: i64,
pub departure_cost: i64,
pub doubling_cost: Option<i64>,
pub voice_crossing: VoiceCrossingPolicy,
pub metric: VoiceLeadingMetric,
}Expand description
Explicit costs and structural policy for exact voice leading.
Fields§
§entrance_cost: i64Cost of a target voice entering without a source.
departure_cost: i64Cost of a source voice leaving without a target.
doubling_cost: Option<i64>Incremental cost for a source supplying an additional target.
voice_crossing: VoiceCrossingPolicyWhether the pitch-sorted voices may cross.
metric: VoiceLeadingMetricMotion norm.
Implementations§
Source§impl VoiceLeadingPolicy
impl VoiceLeadingPolicy
Sourcepub fn new(entrance_cost: i64, departure_cost: i64) -> Self
pub fn new(entrance_cost: i64, departure_cost: i64) -> Self
Builds a squared-distance policy with no doubling and crossings allowed.
Sourcepub fn with_doubling(self, cost: i64) -> Self
pub fn with_doubling(self, cost: i64) -> Self
Enables source doubling at the supplied incremental cost.
Sourcepub fn with_voice_crossing(self, policy: VoiceCrossingPolicy) -> Self
pub fn with_voice_crossing(self, policy: VoiceCrossingPolicy) -> Self
Sets the voice-crossing policy.
Sourcepub fn with_metric(self, metric: VoiceLeadingMetric) -> Self
pub fn with_metric(self, metric: VoiceLeadingMetric) -> Self
Sets the motion norm.
Trait Implementations§
Source§impl Clone for VoiceLeadingPolicy
impl Clone for VoiceLeadingPolicy
Source§fn clone(&self) -> VoiceLeadingPolicy
fn clone(&self) -> VoiceLeadingPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VoiceLeadingPolicy
impl Debug for VoiceLeadingPolicy
impl Eq for VoiceLeadingPolicy
Source§impl PartialEq for VoiceLeadingPolicy
impl PartialEq for VoiceLeadingPolicy
impl StructuralPartialEq for VoiceLeadingPolicy
Auto Trait Implementations§
impl Freeze for VoiceLeadingPolicy
impl RefUnwindSafe for VoiceLeadingPolicy
impl Send for VoiceLeadingPolicy
impl Sync for VoiceLeadingPolicy
impl Unpin for VoiceLeadingPolicy
impl UnsafeUnpin for VoiceLeadingPolicy
impl UnwindSafe for VoiceLeadingPolicy
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