Struct Performance Voices
pub struct PerformanceVoices<const N: usize> { /* private fields */ }Expand description
Allocation-free 1..128-slot normalized/native performance receiver.
All target fields are conjunctive; absent fields are wildcards within this routed endpoint. Unidentified duplicate On events stack. Off releases every held match and retains velocity/expressions through the tail; repeated Off does not restart release or replace its velocity. Expressions update held and released matches, but are not retained for future notes. Volume zero mutes without completing. Concrete duplicate IDs retrigger their existing address, resetting expressions; another address rejects before mutation. Stealing prefers idle, oldest released, then oldest held and reports the old target as completed. Choke removes matching voices immediately; a DSP consumer must implement that policy or choose another receiver.
There are no pedals, MIDI conversion, smoothing, oscillator, endpoint router, thread synchronization or format export. Rank ages stay bounded 0..N-1.
Implementations§
§impl<const N: usize> PerformanceVoices<N>
impl<const N: usize> PerformanceVoices<N>
pub fn new() -> Result<Self, PerformanceError>
pub fn voices(&self) -> &[PerformanceVoice; N]
pub fn reset(&mut self)
pub fn reset(&mut self)
Explicit lifecycle reset discards ownership without generating events. The consumer coordinates host/controller reset and its own DSP history.
pub fn finish(
&mut self,
index: usize,
) -> Result<Option<NoteTarget>, PerformanceError>
pub fn finish( &mut self, index: usize, ) -> Result<Option<NoteTarget>, PerformanceError>
DSP-owned completion, including a consumer-terminated held note. An idle slot returns None; an invalid index leaves the receiver unchanged.
pub fn apply(
&mut self,
data: EventData,
) -> Result<PerformanceChanges<N>, PerformanceError>
pub fn apply( &mut self, data: EventData, ) -> Result<PerformanceChanges<N>, PerformanceError>
Validate one event before changing any receiver state. See Self::preflight
for a complete timed-stream check before a consumer changes DSP/state.
pub fn preflight(
&self,
events: &[Event],
frames: usize,
) -> Result<PerformanceBatchInfo, PerformanceBatchError>
pub fn preflight( &self, events: &[Event], frames: usize, ) -> Result<PerformanceBatchInfo, PerformanceBatchError>
Simulate the entire ordered stream on fixed copied storage without changing this bank. Limits are 1024 events and 65536 frames; zero-frame events use 0. Equal-offset order is retained. Identity conflicts/unsupported/invalid late events reject atomically. Success counts immediate steal/choke completions.
The consumer must keep ownership unchanged between preflight and replay, apply the same events at their sample boundaries, separately budget DSP completions, and stage publication until its own whole operation succeeds. This method does not reserve an output buffer or mutate consumer DSP.
Trait Implementations§
§impl<const N: usize> Clone for PerformanceVoices<N>
impl<const N: usize> Clone for PerformanceVoices<N>
§fn clone(&self) -> PerformanceVoices<N>
fn clone(&self) -> PerformanceVoices<N>
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more