pub struct ScratchGate { /* private fields */ }Expand description
Audio-rate, travel-based scratch crossfader gate.
intent_rate should be the filtered/target hand rate and
rendered_rate should be the rate actually used to advance audible PCM.
Direction changes use intent for responsiveness and rendered motion as a
fallback, while pattern phase follows audible travel in the confirmed
stroke direction.
Implementations§
Source§impl ScratchGate
impl ScratchGate
pub fn new(preset: ScratchPreset) -> Self
pub fn preset(&self) -> ScratchPreset
pub fn set_preset(&mut self, preset: ScratchPreset)
pub fn clicks(&self) -> u8
pub fn set_clicks(&mut self, clicks: u8)
pub fn algorithm_version(&self) -> u32
Sourcepub fn set_algorithm_version(&mut self, _version: u32)
pub fn set_algorithm_version(&mut self, _version: u32)
Retains source compatibility while legacy consumers migrate.
The canonical gate does not emulate replaced algorithms.
Sourcepub fn reset_for_replay(&mut self)
pub fn reset_for_replay(&mut self)
Starts a recorded performance from one defined gate state while retaining its selected technique and click count.
pub fn gate(&self) -> f64
pub fn target(&self) -> f64
pub fn direction(&self) -> i8
pub fn moving(&self) -> bool
pub fn phase(&self) -> f64
pub fn stroke_progress(&self) -> f64
Sourcepub fn learned_span(&self) -> f64
pub fn learned_span(&self) -> f64
Returns the estimate for the active direction.
Before motion starts, this method returns the forward seed.
Sourcepub fn learned_span_for_direction(&self, direction: i8) -> f64
pub fn learned_span_for_direction(&self, direction: i8) -> f64
Returns one direction’s learned source-travel span.
Sourcepub fn span_prediction_confidence(&self) -> f64
pub fn span_prediction_confidence(&self) -> f64
Returns confidence for the active direction.
Before motion starts, this method returns forward confidence.
Sourcepub fn span_prediction_confidence_for_direction(&self, direction: i8) -> f64
pub fn span_prediction_confidence_for_direction(&self, direction: i8) -> f64
Returns zero before the first direction-specific observation.
Confidence reaches one after four observations in that direction.
pub fn snapshot(&self) -> ScratchGateSnapshot
Sourcepub fn restore(
&mut self,
snapshot: &ScratchGateSnapshot,
) -> Result<(), ScratchPerformanceError>
pub fn restore( &mut self, snapshot: &ScratchGateSnapshot, ) -> Result<(), ScratchPerformanceError>
Restores only after the complete gate state passes validation.
Trait Implementations§
Source§impl Clone for ScratchGate
impl Clone for ScratchGate
Source§fn clone(&self) -> ScratchGate
fn clone(&self) -> ScratchGate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more