pub struct VoiceInput { /* private fields */ }Expand description
In-graph voice controller: the per-voice control-signal source.
This GraphModule is inserted into every voice patch and outputs the
per-voice voct, gate, trigger, and velocity signals. Values come from
a shared VoiceControl handle written by PolyPatch (or any external
driver), so allocator state genuinely reaches the DSP graph.
The trigger output is a proper one-shot pulse measured in samples: a
rising edge on the control handle’s trigger request emits 5 V for
TRIGGER_S seconds’ worth of samples, regardless of how briefly the request
was asserted.
The name is kept as VoiceInput for API continuity; conceptually it is the
voice controller.
Implementations§
Source§impl VoiceInput
impl VoiceInput
Sourcepub fn with_control(control: Arc<VoiceControl>, sample_rate: f64) -> Self
pub fn with_control(control: Arc<VoiceControl>, sample_rate: f64) -> Self
Create a voice input driven by a shared control handle at a given sample
rate (used by PolyPatch so it can write values from the outside).
Sourcepub fn control(&self) -> &Arc<VoiceControl>
pub fn control(&self) -> &Arc<VoiceControl>
The shared control handle this input reads from.
Sourcepub fn set_from_voice(&mut self, voice: &Voice)
pub fn set_from_voice(&mut self, voice: &Voice)
Copy the allocator voice’s control values into the shared handle.
Sourcepub fn set_trigger(&mut self, trigger: f64)
pub fn set_trigger(&mut self, trigger: f64)
Set trigger request directly.
Sourcepub fn set_velocity(&mut self, velocity: f64)
pub fn set_velocity(&mut self, velocity: f64)
Set velocity directly.
Trait Implementations§
Source§impl Default for VoiceInput
impl Default for VoiceInput
Source§impl GraphModule for VoiceInput
impl GraphModule for VoiceInput
Source§fn tick(&mut self, _inputs: &PortValues, outputs: &mut PortValues)
fn tick(&mut self, _inputs: &PortValues, outputs: &mut PortValues)
Source§fn set_sample_rate(&mut self, sample_rate: f64)
fn set_sample_rate(&mut self, sample_rate: f64)
Source§fn process_block(
&mut self,
inputs: &BlockPortValues,
outputs: &mut BlockPortValues,
frames: usize,
)
fn process_block( &mut self, inputs: &BlockPortValues, outputs: &mut BlockPortValues, frames: usize, )
Source§fn breaks_feedback_cycle(&self) -> bool
fn breaks_feedback_cycle(&self) -> bool
Source§fn serialize_state(&self) -> Option<Value>
fn serialize_state(&self) -> Option<Value>
alloc only.Source§fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
alloc only.Source§fn introspect(&self) -> Option<&dyn ModuleIntrospection>
fn introspect(&self) -> Option<&dyn ModuleIntrospection>
alloc only.ModuleIntrospection view, if it exposes one. Read moreSource§fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
alloc only.introspect, used to set internal parameters.